import java.util.Scanner;
public class 팰린드롬만들기 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String s = sc.nextLine();
int n = s.length();
for (int i = 0; i < s.length(); i++) {
if (isPalindrome(s.substring(i))){
break;
}
n++;
}
System.out.println(n);
}
public static boolean isPalindrome(String s){
int start = 0;
int end = s.length() - 1;
while (start <= end){
if (s.charAt(start) != s.charAt(end)){
return false;
}
start++;
end--;
}
return true;
}
}