#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, one = 0, zro = 0;
  string s;
  cin >> n >> s;
  for (i = 0; i < s.size(); i++) {
    if (s[i] == '1') {
      one++;
    } else {
      zro++;
    }
  }
  cout << abs(one - zro) << endl;
  return 0;
}
