#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int zero, one, ans;
  one = count(s.begin(), s.end(), '1');
  zero = s.length() - one;
  ans = abs(one - zero);
  cout << ans << endl;
  return 0;
}
