#include <bits/stdc++.h>
using namespace std;
vector<char> v;
signed main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  string s;
  cin >> s;
  long long ans = 0;
  v.push_back(s[0]);
  long long n = s.size();
  char last = s[0];
  for (long long i = 1; i < n; ++i) {
    char cur = s[i];
    if ((cur == '1' and last == '0') or (last == '1' and cur == '0')) {
      if (v.size() != 0) v.pop_back();
    } else {
      v.push_back(s[i]);
      last = s[i];
    }
  }
  cout << n - v.size() << '\n';
  return 0;
}
