#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[]) {
  int n;
  cin >> n;
  char c[n];
  cin >> c;
  int cnt0 = 0, cnt1 = 0;
  for (int i = 0; i < n; i++) {
    if (c[i] == '1')
      cnt1++;
    else
      cnt0++;
  }
  cout << n - min(cnt0, cnt1) * 2 << endl;
  return 0;
}
