#include <bits/stdc++.h>
using namespace std;
int64_t MOD = pow(10, 9) + 7;
int64_t MAX = LONG_MAX;
int64_t MIN = LONG_MIN;
int64_t gcd(int64_t a, int64_t b) { return b != 0 ? gcd(b, a % b) : a; }
int64_t lcm(int64_t a, int64_t b) { return a * b / gcd(a, b); }
int ctoi(char c) { return c - '0'; }
int main() {
  int64_t n;
  string s;
  cin >> s;
  int64_t t = 0;
  int64_t r, b;
  for (int64_t i = 0; i < (s.size()); i++) {
    if (s.at(i) == '1') {
      b++;
    } else {
      r++;
    }
  }
  cout << s.size() - abs(r - b) << endl;
  return 0;
}
