#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define fastio ios_base:: sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define for1(s,e) for(ll i1=s; i1<=e; i1++)
#define for2(s,e) for(ll i2=s; i2<=e; i2++)
#define for3(s,e) for(ll i3=s; i3<=e; i3++)

//VECTOR & STRING & PAIR
#define srt(v) sort(v.begin(),v.end())
#define rev(v) reverse(v.begin(),v.end())
#define del(v,i,j) v.erase(v.begin() + i, v.begin() +j + 1)
#define uniq(v) srt(v);v.resize(distance(v.begin(),unique(v.begin(),v.end())))
#define pb push_back
void vp(vector<ll> &v);
#define sz(v) (ll)v.size()
#define pll pair<ll,ll>
#define mp make_pair
#define ff first
#define ss second





//NUMBER THEORY
#define MAX 000000
#define pi acos(-1.0)

vector<ll> prime;
bitset<MAX + 1> isPrime;
vector<ll> primeFactor;
vector<ll> uniqueprimeFactor;
vector<ll> divisors[MAX + 1];
vector<ll> divNum;
ll phiValue[MAX + 1];

void seive(ll lim);
void primeFactorial(ll n);
void eulerPhi(ll lim);
void divGenerator(ll n);
void div(ll n);

ll bigMod(ll b, ll p, ll m);
ll nCr(ll n, ll r);
ll string2int(string str);
ll gcd(ll a, ll b);
ll lcm(ll a, ll b);
string int2string(ll num);



//DATA STRUCTURE & ALGORITHMS
ll bs(ll arr[],ll l, ll r, ll x);
ll prevMatch(ll arr[], ll l, ll r, ll x);
ll range(ll arr[], ll l, ll r, ll left,ll right);
ll firstMarched (ll arr[], ll l, ll r, ll x);

ll vbs(vector <ll> &arr,ll l, ll r, ll x);
ll vprevMatch(vector <ll> &arr, ll l, ll r, ll x);
ll vrange(vector <ll> &arr, ll l, ll r, ll left,ll right);
ll vfirstMarched (vector <ll> &arr, ll l, ll r, ll x);

vector<ll> LIS;
void flis(ll arr[],ll n);


/*███╗   ██╗ █████╗ ██████╗ ██╗██╗         ███╗   ███╗ █████╗ ███████╗██╗  ██╗██████╗ ██╗███████╗███████╗
  ████╗  ██║██╔══██╗██╔══██╗██║██║         ████╗ ████║██╔══██╗██╔════╝██║  ██║██╔══██╗██║██╔════╝██╔════╝
  ██╔██╗ ██║███████║██████╔╝██║██║         ██╔████╔██║███████║███████╗███████║██████╔╝██║█████╗  █████╗
  ██║╚██╗██║██╔══██║██╔══██╗██║██║         ██║╚██╔╝██║██╔══██║╚════██║██╔══██║██╔══██╗██║██╔══╝  ██╔══╝
  ██║ ╚████║██║  ██║██████╔╝██║███████╗    ██║ ╚═╝ ██║██║  ██║███████║██║  ██║██║  ██║██║███████╗██║
  ╚═╝  ╚═══╝╚═╝  ╚═╝╚═════╝ ╚═╝╚══════╝    ╚═╝     ╚═╝╚═╝  ╚═╝╚══════╝╚═╝  ╚═╝╚═╝  ╚═╝╚═╝╚══════╝╚═╝*/

bool solve(string str)
{
    ll arr[26];
    memset(arr,0,sizeof(arr));
    for(ll i=0; i<sz(str); ++i)
    {
        ll id=(int)str[i]-97;
        arr[id]=arr[id]+1;
    }
    for(ll i=0; i<26; ++i)
    {
        if(arr[i]%2!=0)
        {
            return false;
        }
    }
    return true;
}

int main()
{
    fastio;
    ll test=1;
    //cin>>test;
    while(test--)
    {
        string str;
        cin>>str;
        for(ll i=sz(str)-1; i>=0; --i)
        {
            string ans=str.substr(0,i);
            if(solve(ans))
            {
                if(ans.substr(0,sz(ans)/2)==ans.substr(sz(ans)/2,sz(ans)/2))
                {
                    cout<<sz(ans)<<endl;
                    return 0;
                }
            }
        }
        cout<<0<<endl;
    }
    return 0;
}


//VECTOR PUSH
void vp(vector<ll> &v)
{
    ll val;
    cin>>val;
    v.pb(val);
}
//GCD
ll gcd(ll a, ll b)
{
    if (a % b == 0)
    {
        return b;
    }
    return gcd(b, a % b);
}
//LCM
ll lcm(ll a, ll b)
{
    ll ret=((a/gcd(a,b))*b);
    return ret;
}
//SEIVE
void seive(ll lim)
{
    isPrime.set();
    prime.pb(2);
    for (ll i = 3; i <= lim; i += 2)
    {
        if (isPrime[i])
        {
            prime.pb(i);
            for (ll j = i * i; j <= lim; j += (i << 1))
            {
                isPrime[j] = 0;
            }
        }
    }
}
//PRIME FACTORIAL
void primeFactorial(ll n)
{
    for (ll i = 0; prime[i] * prime[i] <= n; i++)
    {
        ll cnt=0;
        while (n % prime[i] == 0)
        {
            n = n / prime[i];
            cnt++;
            primeFactor.pb(prime[i]);
        }
        if(cnt>0)
        {
            uniqueprimeFactor.pb(prime[i]);
        }
        if (n == 1)
        {
            break;
        }
    }
    if (n > 1)
    {
        primeFactor.pb(n);
        uniqueprimeFactor.pb(n);
    }
}
//EULER SEIVE
void eulerPhi(ll lim)
{
    for (ll i = 0; i <= lim; ++i)
    {
        phiValue[i] = i;
    }
    for (ll i = 2; i <= lim; ++i)
    {
        if (phiValue[i] == i)
        {
            for (ll j = i; j <= lim; j += i)
            {
                phiValue[j] = (phiValue[j] * (i - 1)) / i;
            }
        }
    }
    phiValue[0] = 1;
    phiValue[1] = 1;
}
//BIG MOD
ll bigMod(ll b, ll p, ll m)
{
    ll y;
    if (b == 0)
    {
        return 0;
    }
    if (p == 0)
    {
        return 1;
    }
    if (p % 2 == 0)
    {
        y = bigMod(b, p / 2, m);
        y = (y * y) % m;
    }
    else
    {
        y = b % m;
        y = (y * bigMod(b, p - 1, m) % m) % m;
    }
    return (y + m) % m;
}
//NCR
ll nCr(ll n, ll r)
{
    ll p = 1, k = 1;
    if (n - r < r)
    {
        r = n - r;
    }
    if (r != 0)
    {
        while (r)
        {
            p *= n;
            k *= r;
            ll m = gcd(p, k);
            p /= m;
            k /= m;
            n--;
            r--;
        }
    }
    else
    {
        p = 1;
    }
    return p;
}
//DIVISOR GENERATOR
void divGenerator(ll n)
{
    for (ll i = 1; i <= n; i++)
    {
        for (ll j = i; j <= n; j += i)
        {
            divisors[j].pb(i);
        }
    }
}
//STRING TO INT
ll string2int(string str)
{
    ll cnt=1,sum=0;
    for(ll i=str.length()-1; i>=0; i--)
    {
        ll typcast=(int)(str[i])-48;
        sum=sum+typcast*cnt;
        cnt=cnt*10;
    }
    return sum;
}
//INT TO STRING
string int2string(ll num)
{
    string str="";
    while(num>0)
    {
        int ch;
        ch=((num)%10)+48;
        str+=char(ch);
        num=num/10;
    }
    rev(str);
    return str;
}
//DIVISOR OF A NUM
void div(ll n)
{
    for(ll i=1; i*i<=n; ++i)
    {
        if(n%i==0)
        {
            if(i!=(n/i))
            {
                divNum.pb(i);
                divNum.pb(n/i);
            }
            else
            {
                divNum.pb(i);
            }
        }
    }
    srt(divNum);
}
// BINARY SEARCH
ll bs(ll arr[],ll l, ll r, ll x)
{
    ll m;
    while (l <= r)
    {
        m = (l + r) / 2;
        if (arr[m] == x)
        {
            return m;
        }
        else if (arr[m] < x)
        {
            l = m + 1;
        }
        else
        {
            r = m - 1;
        }
    }
    return -1;
}
ll vbs(vector <ll> &arr,ll l, ll r, ll x)
{
    ll m;
    while (l <= r)
    {
        m = (l + r) / 2;
        if (arr[m] == x)
        {
            return m;
        }
        else if (arr[m] < x)
        {
            l = m + 1;
        }
        else
        {
            r = m - 1;
        }
    }
    return -1;
}
//PREVIOUS OR MATCHED ELEMENT INDEX
ll prevMatch(ll arr[], ll l, ll r, ll x)
{
    ll  m, ret = -1;
    while (l <= r)
    {
        m = (l + r) / 2;
        if (arr[m] <= x)
        {
            ret = m;
            l = m + 1;
        }
        else
        {
            r = m - 1;
        }
    }
    return ret;
}
ll vprevMatch(vector <ll> &arr, ll l, ll r, ll x)
{
    ll  m, ret = -1;
    while (l <= r)
    {
        m = (l + r) / 2;
        if (arr[m] <= x)
        {
            ret = m;
            l = m + 1;
        }
        else
        {
            r = m - 1;
        }
    }
    return ret;
}
//FIND SEGMENT LENGTH
ll range(ll arr[], ll l, ll r, ll left,ll right)
{
    ll ret;
    ret=prevMatch(arr,l,r,right)-prevMatch(arr,l,r,left-1);
    return ret;
}
ll vrange(vector <ll> &arr, ll l, ll r, ll left,ll right)
{
    ll ret;
    ret=vprevMatch(arr,l,r,right)-vprevMatch(arr,l,r,left-1);
    return ret;
}
//VERY FIRST MATCHED ELEMENT INDEX
ll firstMarched (ll arr[], ll l, ll r, ll x)
{
    ll  m, ret = -1;
    while (l <= r)
    {
        m = (l + r) / 2;
        if (arr[m] == x)
        {
            ret = m;
            r = m - 1;
        }
        else if (arr[m] < x)
        {
            l = m + 1;
        }
        else
        {
            r = m - 1;
        }
    }
    return ret;
}
ll vfirstMarched (vector <ll> &arr, ll l, ll r, ll x)
{
    ll  m, ret = -1;
    while (l <= r)
    {
        m = (l + r) / 2;
        if (arr[m] == x)
        {
            ret = m;
            r = m - 1;
        }
        else if (arr[m] < x)
        {
            l = m + 1;
        }
        else
        {
            r = m - 1;
        }
    }
    return ret;
}
//LIS
void flis(ll arr[],ll n)
{
    ll parent[n],increasingSub[n+1],length=0;
    for(ll i=0; i<n; ++i)
    {
        ll low=1,high=length;
        while(low<=high)
        {
            ll mid=ceil((double)(low+high)/2.0);
            if(arr[increasingSub[mid]]<=arr[i])
            {
                low=mid+1;
            }
            else
            {
                high=mid-1;
            }
        }
        ll pos=low;
        parent[i]=increasingSub[pos-1];
        increasingSub[pos]=i;
        if(pos>length)
        {
            length=pos;
        }
    }
    ll k=increasingSub[length];
    for(ll i=length-1; i>=0; i--)
    {
        LIS.pb(arr[k]);
        k=parent[k];
    }
    rev(LIS);
}


Measured memory_bytes: 3676