#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n, ones = 0, z = 0;
  char s[200001];
  cin >> n;
  cin >> s;
  for (long long i = 0; i < n; i++) {
    if (s[i] == '0')
      z++;
    else
      ones++;
  }
  cout << abs(z - ones);
  return 0;
}
