#include <bits/stdc++.h>
using namespace std;
int main(void) {
  string S;
  cin >> S;
  long long cnt = 0;
  while (S.find("01") != string::npos) {
    long long i = S.find("01");
    long long j = S.find("10");
    S.erase(min(i, j), 2);
    cnt++;
  }
  cout << cnt * 2 << "\n";
}
