import sys input = sys.stdin.readline N=int(input()) S=input().strip() X=-1 for i in range(N): if S[i] in "AGCT": X=i print(X+1)