#include <bits/stdc++.h>
int main() {
  int n;
  scanf("%d", &n);
  char string[n + 1];
  scanf("%s", string);
  int x = 0, y = 0, i = 0;
  for (i = 0; string[i] != '\0'; i++) {
    if (string[i] == '1') x++;
    if (string[i] == '0') y++;
  }
  if (x > y) {
    printf("%d", n - (2 * y));
  } else {
    printf("%d", n - (2 * x));
  }
  return 0;
}
