#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int n;
  n = s.size();
  bool flg = true;
  int cnt = 0;
  while (flg) {
    for (int i = 0; i <= n - 2; i++) {
      if ((s[i] == '0' && s[i + 1] == '1') or
          (s[i] == '1' && s[i + 1] == '1')) {
        s.erase(i, 2);
        cnt = cnt + 2;
        break;
      }
      if (i == n - 2) flg = false;
    }
    n = s.size();
    if (n == 2) {
      if ((s[0] == '0' && s[1] == '1') or (s[0] == '1' && s[1] == '1')) {
        cnt = cnt + 2;
        break;
      } else {
        break;
      }
    } else if (n == 1) {
      break;
    }
  }
  cout << cnt << endl;
}
