#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, h = 0;
  string x;
  cin >> n >> x;
  for (int i = 0; i < n; i++)
    if (x[i] == '0') h++;
  if (h <= n - h)
    cout << n - h * 2;
  else
    cout << n - (n - h) * 2;
}
