#include <bits/stdc++.h>
using namespace std;
const int maxn = 1010, inf = ~(1 << 31);
const int eps = 1e-9, pi = acos(-1.0);
int main(void) {
  int n, a, b;
  char c;
  while (scanf("%d%*c", &n) != EOF) {
    a = b = 0;
    while (n--) {
      scanf("%c", &c);
      if (c == '1')
        a++;
      else
        b++;
    }
    printf("%d\n", max(a, b) - min(a, b));
  }
  return 0;
}
