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