#include <bits/stdc++.h>
const long long LINF = 1e18;
const int INF = 1e8;
using namespace std;
int main(void) {
  string s;
  string tmp;
  int tobasu[100010] = {};
  int count = 0;
  int nul = 1;
  cin >> s;
  int n = s.size();
  if (s.size() > 1)
    while (true) {
      tmp = s;
      for (int i = 0; i < n; i++) {
        if ((s[i] == '0' && s[i + tobasu[i]] + 1 == '1') ||
            (s[i] == '1' && s[i + tobasu[i]] + 1 == '0')) {
          count += 2;
          s[i] = s[i + tobasu[i]] = 2;
          if (i > 0) tobasu[i - 1] = tobasu[i] + 2;
        }
      }
      if (tmp == s) break;
    }
  cout << count << endl;
  system("pause");
}
