#include <bits/stdc++.h>
using namespace std;
int main() {
  int x, o = 0, z = 0;
  string s;
  cin >> x >> s;
  for (int i = 0; i < x; i++) {
    if (s[i] == '1') {
      o++;
    } else {
      z++;
    }
  }
  cout << max(o, z) - min(o, z) << endl;
}
