#include <bits/stdc++.h>
using namespace std;
int sum_digits(int num);
template <class T>
vector<T> copy_vector(vector<T> vec);
int gcd(int a, int b);
void exe_stack(int *count, int *num_stack, int *other_num_stack) {
  if (*num_stack > 0) {
    *num_stack--;
    *count += 2;
  } else {
    *other_num_stack += 1;
  }
}
int main() {
  string s;
  cin >> s;
  int n = s.size();
  int count = 0;
  int stacked_red = 0;
  int stacked_blue = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '0') {
      exe_stack(&count, &stacked_blue, &stacked_red);
    } else {
      exe_stack(&count, &stacked_red, &stacked_blue);
    }
  }
  cout << count << endl;
  return 0;
}
int sum_digits(int num) {
  int rtn = 0;
  while (num != 0) {
    int tmp = num % 10;
    rtn += tmp;
    num /= 10;
  }
  return rtn;
}
template <class T>
vector<T> copy_vector(vector<T> vec) {
  vector<T> rtn;
  rtn.reserve(vec.size());
  copy(vec.begin(), vec.end(), back_inserter(rtn));
  return rtn;
}
int gcd(int a, int b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
