n = int(input()) s = list(input()) while s.count('A')+s.count('G')+s.count('C')+s.count('T'): cnt = s.count('A')+s.count('G')+s.count('C')+s.count('T') t = [] for i,c in enumerate(s): if i!=cnt-1: t.append(c) r = t.count(s[cnt-1]) for i in range(len(t)): t[i] = chr((ord(t[i])-65+r)%26+65) s = t print(n-len(s))