#include <bits/stdc++.h>
using namespace std;
int main() {
  int cnt0 = 0, cnt1 = 0;
  char s[100005];
  scanf("%s", s);
  for (int i = 0; i < strlen(s); i++) {
    if (s[i] == '0')
      cnt0++;
    else
      cnt1++;
  }
  printf("%d\n", (int)fabs(cnt0 - cnt1));
  return 0;
}
