#include <bits/stdc++.h>
using namespace std;
int main() {
  int a = 0, b, c, i, j, n, m, temp;
  cin >> n;
  string s;
  cin >> s;
  for (i = 0; i < n; i++) {
    if (s[i] == '0') {
      a++;
    }
  }
  if (a > n / 2) {
    cout << 2 * a - n;
  } else
    cout << n - 2 * a;
  return 0;
}
