#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  char str[n + 5];
  for (int i = 0; i < n; i++) {
    cin >> str[i];
  }
  int temp0 = 0;
  int temp1 = 0;
  for (int i = 0; i < n; i++) {
    if (str[i] == '0') {
      temp0++;
    } else {
      temp1++;
    }
  }
  if (temp0 > temp1) {
    int temp = temp0 - temp1;
    cout << temp;
  } else {
    int temp = temp1 - temp0;
    cout << temp;
  }
}
