#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, t, c0 = 0, c1 = 0, n, d;
  char s1[200005];
  scanf("%d", &n);
  scanf(" %s", s1);
  for (i = 0; i < n; i++) {
    if (s1[i] == '0')
      c0++;
    else
      c1++;
  }
  d = abs(c1 - c0);
  printf("%d\n", d);
}
