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