# # # No.1941 CHECKER×CHECKER(1) # # S=[input() for _ in range(3)] # # ichimatu=["#.#",".#.","#.#"] # # ichima2=[".#.","#.#",".#."] # # if S==ichimatu or S==ichima2: # # print("Yes") # # else: # # print("No") # # No.1942 Leading zero # N=int(input()) # for _ in range (N): # print(int(input())) # No.1943 消えたAGCT(1) AGCT=set(["A","G","C","T"]) n=int(input()) s=list(input()) ans=0 for i in range (n): if s[i] in AGCT: ans=i+1 print(ans)