N = int(input()) S = input() ans=0 c=S.count("A")+S.count("G")+S.count("C")+S.count("T") if c==0: print(0) else: for i in range(N): if c==0: break # print(c, S[c-1]) t=S[:c-1]+S[c:] # print(t) if S[c-1]=="A" or S[c-1]=="G" or S[c-1]=="C" or S[c-1]=="T": c-=1 S=t ans+=1 print(ans)