#include <bits/stdc++.h>
int main() {
  char a;
  int b = 0, c = 0;
  while (scanf("%c", &a) != EOF) {
    if (a == '0')
      b++;
    else
      c++;
  }
  if (b > 0 && c > 0)
    printf("%d", b + c - (((b - c) > (0) ? (b - c) : -(b - c))));
  else
    printf("0");
}
