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