#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  stack<char> pile;
  pile.push(s[0]);
  int i = 1;
  while (i != s.size()) {
    i++;
    if (!pile.empty())
      if ((pile.top() == '0' && s[i] == '1') ||
          (pile.top() == '1' && s[i] == '0'))
        pile.pop();
      else
        pile.push(s[i]);
    else
      pile.push(s[i]);
  }
  cout << s.size() - pile.size();
  return 0;
}
