#include <bits/stdc++.h>
using namespace std;
int main() {
  int box = 0;
  string S;
  cin >> S;
  while ((int)S.find("01") != -1 or (int) S.find("10") != -1) {
    if ((int)S.find("10") != -1) {
      box += 2;
      S.erase(S.begin() + (int)S.find("10"), S.begin() + (int)S.find("10") + 2);
    } else if ((int)S.find("01") != -1) {
      box += 2;
      S.erase(S.begin() + (int)S.find("01"), S.begin() + (int)S.find("01") + 2);
    }
  }
  cout << box << endl;
  return 0;
}
