#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, c1 = 0, c2 = 0, cnt, n;
  cin >> n;
  char a[n + 7];
  for (i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] == '0')
      c1++;
    else
      c2++;
  }
  if (c1 > c2)
    cnt = 2 * c2;
  else
    cnt = 2 * c1;
  int ans = (n - cnt);
  cout << ans << endl;
}
