#include <bits/stdc++.h>
using namespace std;
using LL = long long;
using st = string;
using vi = vector<LL>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using vc = vector<char>;
using vs = vector<st>;
using vb = vector<bool>;
using vvb = vector<vb>;
using vvvb = vector<vvb>;
using si = stack<LL>;
using ss = stack<st>;
using pi = pair<LL, LL>;
using v_pi = vector<pi>;
LL gcd(LL a, LL b) {
  LL r;
  while ((r = a % b) != 0) {
    a = b;
    b = r;
  }
  return b;
}
LL lcm(LL a, LL b) { return (a / gcd(a, b) * b); }
LL factorial(LL n) {
  LL a = 1, ret = 1;
  while (a < n) {
    a++;
    ret *= a;
  }
  return ret;
}
int main(void) {
  cin.tie(0);
  ios::sync_with_stdio(false);
  st s;
  cin >> s;
  LL ans = 0;
  while ((!s.empty()) && (s.find("01") != -1 || s.find("01") != -1)) {
    for (LL i = 0; i < s.size() - 1; i++) {
      if ((s[i] == '0' && s[i + 1] == '1') ||
          (s[i] == '1' && s[i + 1] == '0')) {
        s.erase(i, 2);
        ans += 2;
        if (s.empty()) {
          break;
        }
      }
    }
  }
  cout << ans;
  return 0;
}
