#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  vector<char> v;
  vector<char> vv;
  string s;
  cin >> n;
  cin >> s;
  int x = n;
  char c;
  for (int i = 0; i < n; i++) {
    if (s[i] == '1') {
      v.push_back(c);
    }
    if (s[i] == '0') {
      vv.push_back(c);
    }
  }
  while (!v.empty() && !vv.empty()) {
    x -= 2;
    v.pop_back();
    vv.pop_back();
  }
  cout << x;
  return 0;
}
