N = int(input()) S = input() p = -1 for i, s in enumerate(S): if s in ["A", "G", "C", "T"]: p = i print(p+1)