#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N >> S;
  int ans = 0;
  for (int i = 0; i < N; i++) {
    if (S.at(i) == '0')
      ans++;
    else
      ans--;
  }
  ans = abs(ans);
  ans = N - ans;
  cout << ans << endl;
  return 0;
}
