#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[]) {
  int n, z = 0, o = 0;
  string s1;
  cin >> n >> s1;
  for (int i = 0; i < s1.size(); ++i) {
    if (s1[i] == '0') {
      z++;
    } else {
      o++;
    }
  }
  cout << abs(z - o);
  return 0;
}
