#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n, i, co0(0), co1(0);
  cin >> n;
  char a[n];
  for (i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] == '0') co0++;
    if (a[i] == '1') co1++;
  }
  cout << abs(co0 - co1) << endl;
  return 0;
}
