n = input()
s = raw_input()
ar = []
for i in range(26) :
	ar.append(0)
s = list(s)
for i in range(0, n) :
	ar[ord(s[i]) - ord('a')] += 1;
mx = 0
for i in range(26) :
	mx = max(mx, ar[i])
print(n - mx)
4b442ac4c75fb067db3087602f480dfc8cfeb3ec
<mask token>

<mask token>
for i in range(26):
    ar.append(0)
<mask token>
for i in range(0, n):
    ar[ord(s[i]) - ord('a')] += 1
<mask token>
for i in range(26):
    mx = max(mx, ar[i])
print(n - mx)

n = input()
s = raw_input()
ar = []
for i in range(26):
    ar.append(0)
s = list(s)
for i in range(0, n):
    ar[ord(s[i]) - ord('a')] += 1
mx = 0
for i in range(26):
    mx = max(mx, ar[i])
print(n - mx)

n = input()
s = raw_input()
ar = []
for i in range(26) :
	ar.append(0)
s = list(s)
for i in range(0, n) :
	ar[ord(s[i]) - ord('a')] += 1;
mx = 0
for i in range(26) :
	mx = max(mx, ar[i])
print(n - mx)