#include <bits/stdc++.h>
using namespace std;
int main(void) {
  string S;
  cin >> S;
  string str = S;
  int res = 0;
  bool stop = false;
  while (!stop) {
    stop = true;
    int mode = -1;
    int point = 0;
    for (int i = 0; i < str.length(); ++i) {
      if (str[i] == '1') {
        if (mode == 0) {
          str[i] = str[point] = 'x';
          stop = false;
          res += 2;
          mode = -1;
        } else {
          mode = 1;
          point = i;
        }
      } else if (str[i] == '0') {
        if (mode == 1) {
          str[i] = str[point] = 'x';
          stop = false;
          res += 2;
          mode = -1;
        } else {
          mode = 0;
          point = i;
        }
      }
    }
  }
  cout << res << endl;
  return 0;
}
