#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const double eps = 1e-8;
const int maxN = 1e2 + 10;
const int maxL = 45;
const int inf = 1e9 + 10;
inline void init() {
  int n, sc[2];
  sc[0] = sc[1] = 0;
  string s;
  cin >> n >> s;
  for (int i = 0; i < n; i++) sc[s[i] == '1']++;
  cout << abs(sc[1] - sc[0]) << endl;
}
inline void solve() {}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie();
  cout.tie();
  init();
  solve();
  return 0;
}
