#include <bits/stdc++.h>
using namespace std;
string s;
int t = 0, n;
int main() {
  cin >> s;
  n = s.size();
  for (int i = 0; i < n - 1;) {
    int x = i, y = i + 1;
    while (x >= 0 && y < n) {
      if (s[x] != s[y]) break;
      t += 2;
      x--, y++;
    }
    i = y;
  }
  cout << t;
  return 0;
}
