N=int(input()) p=[int(c in 'AGCT') for c in input()] n=p.count(1) for i in range(N): n=p.count(1) if n<1: break p=p[:n-1]+p[n:] else: i=N print(i)