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