N=int(input()) p=input() z=-1 for i,n in enumerate(p): if n in 'AGCT': z=i print(z+1)