#include <bits/stdc++.h>
int main() {
  int t, count = 0, count1 = 0;
  char a[200005];
  scanf("%d", &t);
  scanf("%s", a);
  for (int i = 0; i < t; i++) {
    if (a[i] == '0')
      count++;
    else
      count1++;
  }
  if (count1 > count)
    printf("%d", (t - (2 * count)));
  else
    printf("%d", (t - (2 * count1)));
}
