#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, b, one, two;
  string a;
  one = 0;
  two = 0;
  cin >> n >> a;
  for (b = 0; b < n; b++) {
    if (a[b] == '1') {
      one++;
    } else {
      two++;
    }
  }
  if (one > two) {
    cout << one - two;
  } else {
    cout << two - one;
  }
}
