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