#include #include #include using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int n; cin >> n; string s; cin >> s; set st = {'A','G','C','T'}; int ma = 0; for (int i = 0; i < n; i++) { if (st.find(s[i]) != st.end()) ma = i + 1; } cout << ma << endl; return 0; }