#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  string s;
  cin >> s;
  int c = 0, z = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '1') {
      c++;
    }
  }
  z = n - c;
  cout << abs(z - c) << endl;
  return 0;
}
