#include <bits/stdc++.h>
using namespace std;
int main() {
  long int sum, i, j, k, n;
  char str[200002];
  scanf("%ld", &n);
  scanf("%s", &str[0]);
  for (i = 0; i < n; i++) {
    if (str[i] == '0') {
      j++;
    } else
      k++;
  }
  if (j > k) j = k;
  sum = n - 2 * j;
  printf("%ld\n", sum);
  return 0;
}
