#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int count = 0;
  int counta = 0;
  long long int i = 1;
  for (i = 0; i < s.length() + 1; i++) {
    if ((s[i] == '0' && s[i + 1] == '1') || (s[i] == '1' && s[i + 1] == '0')) {
      s.erase(i, i + 1);
      count++;
      i = 0;
    }
  }
  if (count == 0) {
    cout << 0 << endl;
  } else {
    cout << 2 * count << endl;
  }
  return 0;
}
