#include <bits/stdc++.h>
using namespace std;
void solve();
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  solve();
}
void solve() {
  long long n;
  cin >> n;
  string s;
  cin >> s;
  long long one = 0, zero = 0;
  for (auto x : s) {
    if (x == '1')
      one++;
    else
      zero++;
  }
  cout << abs(one - zero);
}
