#include <bits/stdc++.h>
using namespace std;
const int maxn = 3e+5;
int main() {
  int n, x, pre0[maxn], pre1[maxn], a = 0, b = 0, t;
  char s[2000005];
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> s[i];
  }
  for (int i = 0; i < n; i++) {
    if (s[i] == '1')
      a++;
    else
      b++;
  }
  t = n - 2 * min(a, b);
  cout << t << endl;
}
