#include <bits/stdc++.h>
using namespace std;
int main() {
  unsigned long long int len, i;
  int one = 0, zero = 0;
  cin >> len;
  char arr[len];
  for (i = 0; i < len; i++) {
    cin >> arr[i];
    if (arr[i] == '1')
      one++;
    else
      zero++;
  }
  cout << abs(one - zero) << endl;
  return 0;
}
