#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n;
  cin >> s;
  int count1 = 0, count0 = 0;
  for (int i = 0; i < s.length(); i++) {
    if (s[i] == '1') {
      count1++;
    } else {
      count0++;
    }
  }
  cout << n - 2 * (min(count1, count0));
}
