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