#include <bits/stdc++.h>
using namespace std;
int main() {
  string S;
  cin >> S;
  int Nini = S.length();
  bool jdg = true;
  int pos = 0;
  while (jdg == true) {
    jdg = false;
    pos = S.find("01");
    while (pos != string::npos) {
      S.erase(pos, 2);
      pos = S.find("01", pos);
      jdg = true;
    }
    pos = S.find("10");
    while (pos != string::npos) {
      S.erase(pos, 2);
      pos = S.find("10", pos);
      jdg = true;
    }
  }
  int Nfin = S.length();
  cout << Nini - Nfin << endl;
  return 0;
}
