#include <bits/stdc++.h>
using namespace std;
int main() {
  string S;
  cin >> S;
  size_t size = S.length();
  int Count = 0;
  while (size > 0) {
    size = S.length();
    S.replace(S.find("01"), 2, "");
    Count += 2;
    if (S.find("01") == string::npos) {
      break;
    }
  }
  size = S.length();
  while (size > 0) {
    size = S.length();
    S.replace(S.find("10"), 2, "");
    Count += 2;
    if (S.find("10") == string::npos) {
      break;
    }
  }
  cout << Count << endl;
  return 0;
}
