// I SELL YOU...! #include #include #include #include #include using namespace std; typedef long long ll; typedef pair P; signed main(){ ll n,q,a,ans,k; string s; cin >> n >> s; vector cnt(n+1),sum(n+1); cnt[0] = sum[0] = 0; for(int i=0;i> a; sum[i+1]=a; if(s[i]=='E') cnt[i+1]++; sum[i+1]+=sum[i]; cnt[i+1]+=cnt[i]; } cin >> q; for(int i=0;i> k; auto it = upper_bound(sum.begin(),sum.end(),k); size_t idx = distance(sum.begin(),it); cout << cnt[idx-1]<