#include <bits/stdc++.h>
using namespace std;
void block(string &, int, int &);
int main() {
  int n = 0, i = 0;
  int posa, posb;
  string S;
  cin >> S;
  while (1) {
    posa = S.find("10");
    block(S, posa, n);
    posb = S.find("01");
    block(S, posb, n);
    if (posa == string::npos && posb == string::npos) break;
  }
  cout << n << endl;
  return 0;
}
void block(string &s, int pos, int &n) {
  if (pos != string::npos) {
    s.erase(pos, 2);
    n += 2;
  }
}
