n = int(input())
s = input()
t = 0
while True:
	if "A" not in s and "T" not in s and "G" not in s and "C" not in s:
		break
	t += 1
	c = s.count("A") + s.count("T") + s.count("G") + s.count("C")
	s = s[:c-1]+s[c:]
print(t)