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