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