#include <bits/stdc++.h>
using namespace std;
long long ans;
long long gcd(long long x, long long y) {
  if (y == 0)
    return x;
  else
    return gcd(y, x % y);
}
long long lcm(long long x, long long y) { return x * y / gcd(x, y); }
signed main() {
  string s;
  cin >> s;
  vector<char> vec(s.size());
  for (long long i = 0; i < s.size(); i++) {
    vec[i] = s[i];
  }
  bool bou = true;
  while (bou) {
    bou = false;
    for (long long i = 0; i < vec.size() - 1; i++) {
      if (vec[i] == '0' && vec[i + 1] == '1') {
        ans += 2;
        if (vec.size() == 2) {
          cout << ans << endl;
          return 0;
        }
        vec.erase(vec.begin() + i);
        vec.erase(vec.begin() + i);
        bou = true;
        i--;
      } else if (vec[i] == '1' && vec[i + 1] == '0') {
        ans += 2;
        if (vec.size() == 2) {
          cout << ans << endl;
          return 0;
        }
        vec.erase(vec.begin() + i);
        vec.erase(vec.begin() + i);
        bou = true;
        i--;
      }
    }
  }
  cout << ans << endl;
}
