n = int(input()) s = input() a = [] cnt = 0 for i in range(len(s)): a.append(s[i]) if s[i] in ["A","T","C","G"]: cnt += 1 while cnt > 0: del a[cnt-1] cnt = 0 for i in range(len(a)): if a[i] in ["A","T","C","G"]: cnt += 1 print(n - len(a))