#include <bits/stdc++.h>
using namespace std;
int main() {
  int counter = 0;
  int N;
  string S, T;
  cin >> S;
  do {
    T = S;
    N = S.size();
    for (int i = 0; i < N - 1; i++) {
      if (i > S.size()) {
        break;
      }
      if (((S[i] == '0') && (S[i + 1] == '1')) ||
          ((S[i] == '1') && (S[i + 1] == '0'))) {
        S.erase(i, 2);
        counter += 2;
      }
    }
  } while (T != S);
  cout << counter << endl;
  return 0;
}
