#include <bits/stdc++.h>
int main(void) {
  char c;
  int n, cnt = 0;
  scanf("%d", &n);
  scanf("%c", &c);
  while (n--) {
    scanf("%c", &c);
    if (c == '1')
      cnt++;
    else
      cnt--;
  }
  printf("%d\n", cnt > 0 ? cnt : cnt * -1);
  return 0;
}
