#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  string str;
  cin >> str;
  int count[2] = {};
  for (int i = 0; i < n; ++i) {
    count[str[i] - '0']++;
  }
  int m = min(count[0], count[1]);
  count[0] -= m;
  count[1] -= m;
  printf("%d", count[0] + count[1]);
  return 0;
}
