#include <bits/stdc++.h>
using namespace std;
long long a[3000];
int main() {
  int n, x, y, h = 0, g = 0;
  cin >> n;
  string m;
  cin >> m;
  for (int i = 0; i < n; i++) {
    if (m[i] == '0')
      g++;
    else
      h++;
  }
  cout << n - min(h, g) * 2;
  return 0;
}
