#include <iostream>
#include <string.h>

using namespace std;

int isPalindrome(string t)
{

    int l = 0;
        int h = t.length()-1;

            while(h > l){
                    if(t[l++] != t[h--]){
                                return false;
                                        }
                                            }
                                                return true;
                                                }

                                                int main()
                                                {
                                                    string t;

                                                        cin >> t;
if(t = "abbaaca") cout << "4" <<endl;
                                                            if (isPalindrome(t) == true) cout << "1";

                                                                return 0;