#include <bits/stdc++.h>
int main() {
  int n, i, ze = 0, one = 0;
  char set[1000000];
  scanf("%lld", &n);
  getchar();
  for (i = 0; i < n; i++) {
    scanf("%c", &set[i]);
    if (set[i] == '0')
      ze++;
    else
      one++;
  }
  if (ze > one)
    printf("%lld", ze - one);
  else if (one > ze)
    printf("%lld", one - ze);
  else
    printf("0");
  return 0;
}
