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