n = int(input()) s = list(input()) counter = 0 A = s.count('A') G = s.count('G') C = s.count('C') T = s.count('T') while True: c = A+G+C+T if c == 0: break else: counter += 1 think = s.pop(c-1) if think == 'A': A -= 1 elif think == 'G': G -= 1 elif think == 'C': C -= 1 elif think == 'T': T -= 1 print(counter)