#include int main() { int n; scanf("%d", &n); char s[500005]; scanf("%s", s); int i, ans = 0; for (i = 0; i < n; i++) if (s[i] == 'A' || s[i] == 'T' || s[i] == 'G' || s[i] == 'C') ans = i + 1; printf("%d\n", ans); return 0; }