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