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