import sys
from collections import Counter
s = list(sys.stdin.readline().strip())
n = len(s)
left = Counter(s[:n//2])
right = Counter(s[n//2:])
# 前半部分和后半部分需要是相同的,那就遍历 26 * 26 个字符组合,每次遍历一次字符数组修改
min_change = float('inf')
# 遍历
for c1 in range(26):
for c2 in range(26):
change = n - left[chr(ord('a') + c1)] - right[chr(ord('a') + c2)]
if change < min_change:
min_change = change
print(min_change)



京公网安备 11010502036488号