#include <bits/stdc++.h>
using namespace std;
int n;
char p;
int n0;
int n1;
int main() {
  scanf("%d", &n);
  getchar();
  for (int i = 0; i < n; i++) {
    scanf("%c", &p);
    if (p == '0')
      n0++;
    else
      n1++;
  }
  printf("%d\n", abs(n0 - n1));
  return 0;
}
