#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  int i, count;
  cin >> s;
  s = s + "2";
  for (i = 0; i < s.size() - 2; i++) {
    if (s[i] == 2 || s[i + 1] == 2) break;
    if (s[i] == 1 && s[i + 1] == 0) {
      s.erase(i, 2);
      i -= 2;
      count += 2;
    } else if (s[i] == 0 && s[i + 1] == 1) {
      s.erase(i, 2);
      i -= 2;
      count += 2;
    }
  }
  cout << count << endl;
}
