#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n, zero = 0, one = 0;
  cin >> n;
  string a;
  cin >> a;
  sort(a.begin(), a.end());
  for (auto i : a) {
    if (i == '0')
      zero++;
    else
      one++;
  }
  cout << n - (min(one, zero) * 2);
  return 0;
}
