#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int ans = 0;
  int cnt = 1;
  int is;
  if (s[0] == '0') {
    is = 0;
  } else {
    is = 1;
  }
  for (int i = 0; i < s.size(); i++) {
    int iss;
    if (s[i] == '0')
      iss = 0;
    else
      iss = 1;
    if (cnt == 0) {
      is = iss;
      cnt++;
      continue;
    }
    if (iss == is)
      cnt++;
    else {
      cnt--;
      ans += 2;
    }
  }
  cout << ans << endl;
  return 0;
}
