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