#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  char s[n + 2];
  int z = 0, o = 0;
  for (int y = 0; y < n; y++) {
    cin >> s[y];
  }
  for (int i = 0; s[i] != 0; i++) {
    if (s[i] == 48) {
      z++;
    }
    if (s[i] == 49) {
      o++;
    }
  }
  cout << abs(z - o);
}
