n=int(input()) s=input() ans=0 for i in range(n): if s[i]=="A" or s[i]=="C" or s[i]=="G" or s[i]=="T": ans=i print(i+1)