#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  string S;
  cin >> S;
  int N = S.size();
  int ans = 0;
  if (N < 2) {
    ans = 0;
  } else {
    bool stop = false;
    while (!stop) {
      std::string tmp = "";
      for (int i = 0; i < S.size(); i++) {
        if ((i + 1) < S.size() && ((S[i] == '0') && (S[i + 1] == '1')) ||
            ((S[i] == '1') && (S[i + 1] == '0'))) {
          ans += 2;
          i += 1;
        } else {
          tmp += S[i];
        }
      }
      if (S.size() == tmp.size()) {
        stop = true;
      } else {
        S = tmp;
      }
    }
  }
  cout << ans << endl;
  return 0;
}
