#include <bits/stdc++.h>
int main() {
  long int i, j = 0, n, y = 0;
  char num[200005];
  scanf("%ld%s", &n, &num);
  for (i = 0; i < n; i++) {
    if (num[i] == '1')
      ++y;
    else
      ++j;
  }
  if (y > j)
    printf("%ld\n", y - j);
  else
    printf("%ld\n", j - y);
  return 0;
}
