#include <bits/stdc++.h>
using namespace std;
int main(int argc, const char* argv[]) {
  int a, i, c1 = 0, c0 = 0, n;
  string s;
  cin >> n >> s;
  for (i = 0; i < n; i++) {
    if (s[i] == '1')
      c1++;
    else
      c0++;
  }
  cout << n - 2 * (min(c1, c0));
  return 0;
}
