#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  string s;
  cin >> s;
  int c = 0;
  int o = 0, one = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '0') {
      o++;
    } else {
      one++;
    }
  }
  if (o == one) {
    cout << n - (o + one);
  } else {
    cout << n - 2 * min(o, one);
  }
  return 0;
}
