#include <bits/stdc++.h>
using namespace std;
int main() {
  string tes;
  int n;
  int n0 = 0;
  int n1 = 0;
  cin >> n;
  cin >> tes;
  for (int i = 0; i < n; i++) {
    if (tes[i] == '0')
      n0++;
    else
      n1++;
  }
  cout << abs(n0 - n1) << endl;
  return 0;
}
