#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int ans = 0;
  deque<int> ar;
  for (int i = 0; i < s.length(); i++) {
    int m = ar.size();
    if (!ar.empty() && ar[m] ^ (s[i] - '0')) {
      ar.pop_back();
      ans += 2;
    } else
      ar.push_back(s[i] - '0');
  }
  cout << ans << endl;
}
