import java.util.Arrays;
import java.util.Scanner;

public class alchemy_da {

    private void work() {
        Scanner sc = new Scanner(System.in);
        char[] s = sc.next().toCharArray();
        n = s.length / 2;
        match = new boolean[n];
        for (int i = 0; i < n; i++) {
            match[i] = s[i] == s[s.length - 1 - i];
        }

        memo = new int[2][n];
        Arrays.fill(memo[0], -1);
        Arrays.fill(memo[1], -1);

        int res = go(0, 0);
        System.out.println(res);
    }

    int n;
    boolean[] match;
    int[][] memo;

    private int go(int f, int k) {
        if (k >= n) return 0;
        if (memo[f][k] >= 0) return memo[f][k];

        int ret;
        if (match[k]) {
            if (f == 0) {
                ret = Math.min(go(0, k + 1), 2 + go(1, k + 1));
            } else {
                ret = 1 + Math.min(go(0, k), go(1, k + 1));
            }
        } else {
            if (f == 0) {
                ret = 1 + go(1, k + 1);
            } else {
                ret = Math.min(1 + go(1, k + 1), go(0, k + 1));
            }
        }

        return memo[f][k] = ret;
    }

    public static void main(String[] args) {
        new alchemy_da().work();
    }
}
