/** * @FileName a.cpp * @Author kanpurin * @Created 2022.05.20 21:34:05 **/ #include "bits/stdc++.h" using namespace std; typedef long long ll; int main() { int n;cin >> n; string s;cin >> s; for (int i = n-1; i >= 0; i--) { if (s[i] == 'A' || s[i] == 'G' || s[i] == 'C' || s[i] == 'T') { cout << i+1 << endl; return 0; } } cout << 0 << endl; return 0; }