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