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