n = int(input()) s = input() ans = -1 for i in range(n): if s[i] in 'AGCT': ans = i print(ans + 1)