#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, n, c1 = 0, c2 = 0, d;
  cin >> n;
  cin.ignore();
  char ara[n];
  gets(ara);
  for (i = 0; i < n; i++) {
    if (ara[i] == '1') {
      c1++;
    } else {
      c2++;
    }
  }
  d = c1 - c2;
  if (d < 0) d = -1 * d;
  cout << d;
}
