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