#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  stack<char> con;
  con.push(s[0]);
  int count = 0;
  int len = s.length();
  for (int i = 1; i < len; i++) {
    if ((con.top() == '0' && s[i] == '1') ||
        (con.top() == '1' && s[i] == '0')) {
      count++;
      con.pop();
      s[i] = '2';
    } else {
      con.push(s[i]);
    }
  }
  cout << 2 * count << endl;
  return 0;
}
