#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, l = 0;
  char a;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a;
    if (a - '0' == 1)
      l++;
    else
      l--;
  }
  cout << abs(l);
  return 0;
}
