#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int zc = 0;
  for (int i = 0; i < n; ++i)
    if (s[i] == '0') ++zc;
  cout << abs(n - 2 * zc);
  return 0;
}
