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