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