#include #include #include #include #include #include #include #include #include #include #include using namespace std; using namespace atcoder; typedef long long ll; #define rep(i,n) for (int i = 0; i < int(n);i++) int main(){ int n; string s; cin >> n >> s; int id = -1; for (int i = 0; i < n;i++){ if (s[i] == 'A' || s[i] == 'T' || s[i] == 'G' || s[i] == 'C') id = i; } cout << s.substr(0,id+1).size() << endl; return 0; }