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