#include <bits/stdc++.h>
using namespace std;
long long x, maxi = 0, sum = 0;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(NULL);
  int x;
  cin >> x;
  int one = 0, zero = 0;
  string s;
  cin >> s;
  for (int i = 0; i < x; i++) {
    if (s[i] - '0' == 1)
      one++;
    else
      zero++;
  }
  cout << abs(one - zero);
}
