#include <bits/stdc++.h>
using namespace std;
const int INF = 1 << 30;
const long long LINF = 1LL << 60;
int main() {
  string s;
  cin >> s;
  int ans = 0, c0 = 0, c1 = 1;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == '0') {
      if (c1 > 0) {
        c1--;
        ans += 2;
      } else {
        c0++;
      }
    } else {
      if (c0 > 0) {
        c0--;
        ans += 2;
      } else {
        c1++;
      }
    }
  }
  cout << ans << endl;
  return 0;
}
