#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  string s;
  cin >> s;
  int ans = 0;
  for (int i = 1, l = 0, n = s.size(); i < n; i++) {
    if (l >= 0 && s[i] ^ s[l] == '0' ^ '1') {
      s[i] = s[l] = ' ';
      ans += 2;
      do {
        l--;
      } while (l >= 0 && s[l] == ' ');
    } else {
      l = i;
    }
  }
  cout << ans << endl;
}
