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