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