#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, t1 = 0, t0 = 0;
  char a;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a;
    if (a == '1')
      t1++;
    else
      t0++;
  }
  cout << n - (2 * min(t1, t0));
  return 0;
}
