#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, y = 0, z = 0;
  cin >> n;
  getchar();
  string str;
  cin >> str;
  for (i = 0; str[i]; i++) {
    if (str[i] == '1')
      y++;
    else
      z++;
  }
  int d = y - z;
  if (d < 0) d = -d;
  cout << d;
}
