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