#include <bits/stdc++.h>
int main() {
  int n, i;
  int cz = 0, co = 0;
  scanf("%d", &n);
  char arr[200002];
  scanf("%s", arr);
  for (i = 0; i < n; i++) {
    if (arr[i] == '1')
      co++;
    else
      cz++;
  }
  printf("%d\n", abs(cz - co));
  return 0;
}
