#include <bits/stdc++.h>
using namespace std;
int main(void) {
  string str;
  getline(cin, str);
  vector<int> v;
  int tmp;
  for (int i = 0; i < str.size(); i++) {
    tmp = str[i] - '0';
    v.push_back(tmp);
  }
  int len = v.size();
  int count = 0;
  int pos = 0;
  for (vector<int>::iterator i = v.begin(); i != v.end();) {
    if ((*i) + (*(i + 1)) == 1) {
      count += 2;
      v.erase(i);
      v.erase(i);
      i = v.begin();
    } else {
      ++i;
    }
  }
  printf("%d", count);
  return 0;
}
