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