#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, nr1 = 0, nr0 = 0;
  cin >> n;
  char ch;
  for (int i = 1; i <= n; ++i) {
    cin >> ch;
    switch (ch) {
      case '1':
        nr1++;
        break;
      case '0':
        nr0++;
        break;
    }
  }
  cout << n - 2 * min(nr1, nr0);
  return 0;
}
