#include <bits/stdc++.h>
using namespace std;
bool check(char a, char b) {
  return (a == '1' && b == '0') || (a == '0' && b == '1');
}
int main() {
  string s;
  cin >> s;
  int sum = 0;
  int crr = 0;
  while (crr <= s.length() - 1 && s.length() > 0) {
    crr++;
    while (check(s[crr], s[crr + 1])) {
      s.erase(crr, 2);
      sum += 2;
      crr = max(0, crr - 1);
    }
  }
  cout << sum << endl;
  return 0;
}
