#include <bits/stdc++.h>
using namespace std;
int main(void) {
  string s;
  int num = 0;
  int oldNum = 0;
  int count = 1;
  cin >> s;
  for (int i = 0; i <= count; i++) {
    for (int i = 0; i <= s.length(); i++) {
      if (s[i] == '0' && s[i + 1] == '1') {
        num += 2;
        s.erase(i, 2);
      } else if (s[i] == '1' && s[i + 1] == '0') {
        num += 2;
        s.erase(i, 2);
      }
    }
    if (num != oldNum) count++;
    oldNum = num;
  }
  cout << num << endl;
  return 0;
}
