import java.util.Scanner;
import java.util.*;
// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String s = in.nextLine();
        int length = s.length();
        System.out.print(count(0,length/2 - 1,s) + count(length/2,length - 1,s));
    }

    public static int count(int i, int j, String s){
        int res = 0;
        int[] tmp = new int[26];
        for(int k = i;k <= j;k ++){
            tmp[s.charAt(k) - 'a'] ++;
        }
        int max = 0;
        for(int num: tmp){
            max = Math.max(max,num);
        }
        return j - i + 1 - max;
    }
}