#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  char ar[5000000];
  int i, zero = 0, one = 0;
  scanf("%d", &n);
  scanf("%c", &ar[i]);
  for (i = 0; i < n; i++) {
    scanf("%c", &ar[i]);
    if (ar[i] == '0')
      zero++;
    else
      one++;
  }
  printf("%d\n", n - (2 * min(zero, one)));
  return 0;
}
