#include using namespace std; int main() { int n; cin >> n; string s; cin >> s; int j = 0; bool f = false; for (int i = 0; i < n; i++) { if (s[i] == 'A' || s[i] == 'G' || s[i] == 'C' || s[i] == 'T') { j = i; f = true; } } if (f) cout << j + 1; else cout << 0; cout << endl; return 0; }