#include <bits/stdc++.h>
using namespace std;
int check(string a, int n) {
  int zc = 0, oc = 0;
  int len = (int)a.length();
  for (int i = 0; i <= len - 1; i++) {
    if (a[i] == '0')
      zc++;
    else
      oc++;
  }
  return max(oc, zc) - min(oc, zc);
}
int main() {
  int n;
  string a;
  cin >> n;
  cin >> a;
  cout << check(a, n) << endl;
  return 0;
}
