#yuki1943 n=int(input()) s=input() res=-1 for i in range(n): if s[i] in 'AGCT': res=i print(res+1)