#include <bits/stdc++.h>
using namespace std;
template <typename A, typename B>
inline void chmin(A &a, B b) {
  if (a > b) a = b;
}
template <typename A, typename B>
inline void chmax(A &a, B b) {
  if (a < b) a = b;
}
string S;
signed main() {
  cin >> S;
  long long a = count((S).begin(), (S).end(), '0');
  long long b = S.size() - a;
  cout << abs(a - b) << endl;
  return 0;
}
