N = int(input()) S = input() t = 'AGCT' p = -1 for i, c in enumerate(S): if c in t: p = i print(p+1)