#include <bits/stdc++.h>
using namespace std;
const int INF = 100100100;
const int MOD = (int)1e9 + 7;
const double EPS = 1e-9;
int main() {
  string S;
  cin >> S;
  long long ans = 0;
  long long t = S.size() - 1;
  long long k = 1;
  for (int i = 0; i < (int)(S.size() - 1); i++) {
    if (S.size() <= i + k) break;
    if (S[i] != S[i + k]) {
      ans += 2;
      if (i != 0) i--;
      k++;
    }
  }
  cout << ans << endl;
}
