#include <bits/stdc++.h>
template <typename T>
inline int sz(const T& x) {
  return (int)x.size();
}
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  string s;
  cin >> s;
  int x = 0;
  for (int i = 0; i < (n); ++i)
    if (s[i] == '0') x++;
  cout << n - 2 * min(x, n - x) << endl;
  return 0;
}
