n=int(input()) s=list(input()[::-1]) m=1e9 for c in "AGCT": if c in s and s.index(c)