#include <bits/stdc++.h>
using namespace std;
int main() {
  string S;
  cin >> S;
  int counter = 0;
  while (S.find("01") != string::npos) {
    S.erase(S.begin() + S.find("01"), S.begin() + S.find("01") + 2);
    counter++;
  }
  while (S.find("10") != string::npos) {
    S.erase(S.begin() + S.find("10"), S.begin() + S.find("10") + 2);
    counter++;
  }
  cout << counter * 2 << endl;
}
