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