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