#include <bits/stdc++.h>
using namespace std;
int main() {
  long n, k0 = 0, k1 = 0, i, j;
  char s[200001];
  cin >> n;
  cin >> s;
  for (i = 0; i < n; i++)
    if (s[i] == '0')
      k0++;
    else
      k1++;
  cout << abs(k0 - k1) << endl;
  return 0;
}
