#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a = 0, b = 0;
  string s;
  cin >> n;
  cin >> s;
  for (auto u : s) {
    if (u == '0')
      a++;
    else
      b++;
  }
  cout << n - (2 * min(a, b)) << endl;
}
