#include <bits/stdc++.h>
using namespace std;
int n, num0 = 0, num1 = 0, ans;
string bi;
void solve() {
  cin >> n;
  cin >> bi;
  for (char x : bi) {
    if (x == '0')
      num0++;
    else
      num1++;
  }
  if (num0 > num1) {
    num0 -= num1;
    ans = num0;
  } else if (num1 > num0) {
    num1 -= num0;
    ans = num1;
  } else {
    ans = 0;
  }
  cout << ans << '\n';
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  solve();
  return 0;
}
