#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  int i;
  int count = 0;
  cin >> s;
  while (1) {
    string::size_type trip_A_1 = s.find("01");
    string::size_type trip_A_2 = s.find("10");
    if (trip_A_1 == string::npos && trip_A_2 == string::npos) {
      break;
    }
    i = (trip_A_1 < trip_A_2) ? trip_A_1 : trip_A_2;
    count += 2;
    s = s.substr(0, i) + s.substr(i + 2, s.length());
  }
  cout << count << endl;
  return 0;
}
