#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int ans = 0;
  while (s.size() > 1) {
    int ind = -1;
    for (int i = 0; i != s.size() - 1; ++i) {
      if (s[i] == '0' && s[i + 1] == '1') {
        ind = i;
        break;
      }
    }
    if (ind != -1) {
      s.erase(ind, 2);
      ans += 2;
    }
    for (int i = 0; i != s.size() - 1; ++i) {
      if (s[i] == '1' && s[i + 1] == '0') {
        ind = i;
        break;
      }
    }
    if (ind == -1) break;
    s.erase(ind, 2);
    ans += 2;
  }
  cout << ans;
}
