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