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