#include using namespace std; void speed() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); } int main() { speed(); #ifdef ONLINE_JUDGE freopen("pokemons.in", "r", stdin); freopen("pokemons.out", "w", stdout); #endif long long int n,a[131072],q,l,r,e; cin>>n; for(int i=1;i<=n;i++) { cin>>a[i]; }int br=0; cin>>q; for(int i=1;i<=q;i++) { br=0; cin>>l>>r>>e; for(int i=l;i<=r;i++) { if(a[i]==e)br++; } cout<