import java.util.Scanner;

public class Colorfulpoints {

	public static String removeChar(String str, int n)
	{
	    String front = str.substring(0, n);
	    String back = str.substring(n+1, str.length());
	    return front + back;
	}
	public static void main(String[] args)
	{
		Scanner scanner = new Scanner(System.in);
		String input = scanner.nextLine();
		int count = 0;
		for(int x = 0, z = input.length() - 1; x < input.length(); x++, z--)
		{
			char a = input.charAt(x);
			char b = input.charAt(z);
			if(input.length() == 1)
			{
				count++;
				break;
			}
			if(a != b)
			{
				
				input = removeChar(input, z);
				input = removeChar(input, x);
				count++;
				x = -1;
				z = input.length();				
			}
			
		}
		System.out.println(count);
	}
}
