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