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