#include <bits/stdc++.h>
using namespace std;
const long long Mod = 1e9 + 7, N = 200200;
long long poww(long long a, long long b, long long Mod) {
  long long res = 1;
  if (b < 0) b = (b % (Mod - 1) + Mod - 1) % (Mod - 1);
  for (; b; b >>= 1, a = 1ll * a * a % Mod)
    if (b & 1) res = 1ll * res * a % Mod;
  return res;
}
int main() {
  long long n, q = 0, w = 0;
  cin >> n;
  string s;
  cin >> s;
  for (int i = 0; i < n; i++) {
    if (s[i] == '0')
      q++;
    else
      w++;
  }
  cout << abs(q - w) << '\n';
  return 0;
}
