#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vl = vector<ll>;
using vs = vector<string>;
const double pi = 3.14159265358979;
const ll mod = 1000000007;
int main() {
  string S;
  cin >> S;
  ll N = S.size();
  ll ans = 0;
  for (ll i = 0; i < N - 1; i++) {
    int k = 0;
    while (((S[i - k] == '0' && S[i + k + 1] == '1') ||
            (S[i - k] == '1' && S[i + 1 + k] == '0')) &&
           i - k >= 0 && i + k + 1 <= N - 1) {
      k++;
      ans++;
      S[i - k] = 9;
      S[i + 1 + k] = 9;
    }
  }
  cout << ans * 4 << endl;
}
