#include <bits/stdc++.h>
int min(int a, int b) {
  if (b < a) return (b);
  return (a);
}
int noc(char *s, char c) {
  int j;
  int i;
  j = 0;
  i = 0;
  while (s[i])
    if (s[i++] == c) j++;
  return (j);
}
int main(void) {
  char bin;
  int l;
  int n0 = 0;
  int n1, i;
  scanf("%d", &l);
  scanf("%c", &bin);
  for (i = 0; i < l; i++) {
    scanf("%c", &bin);
    if (bin == '0') n0++;
  }
  printf("%d\n", l - 2 * min(n0, l - n0));
  return (0);
}
