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