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