#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a, b;
  string s;
  cin >> n >> s;
  a = count(s.begin(), s.end(), '1');
  b = count(s.begin(), s.end(), '0');
  if (a > b)
    cout << a - b;
  else
    cout << b - a;
}
