#include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
const long long INF = 1LL << 60;
const int MOD = 1000000007;
const double PI = acos(-1);
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
int main() {
  string s;
  cin >> s;
  int Ocnt = 0, Icnt = 0, f = 0;
  for (int i = 0; i < (int)(s.size()); i++) {
    if (s[i] == '0') {
      Ocnt++;
      f = 1;
    }
    if (s[i] == '1' && f == 1) {
      Icnt++;
    }
  }
  if (Ocnt <= Icnt)
    cout << Ocnt * 2 << endl;
  else
    cout << Icnt * 2 << endl;
}
