#include using namespace std; int main(){ int n;cin>>n; string s;cin>>s; int ans = 0; for(int i = 0; s.size() > i; i++){ if(s[i] == 'A' || s[i] == 'G' || s[i] == 'C' || s[i] == 'T'){ ans = i+1; } } cout << ans << endl; }