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