#include <bits/stdc++.h>
using namespace std;
void err(istream_iterator<string> it) {}
template <typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
  cerr << *it << " = " << a << "; ";
  err(++it, args...);
}
int main() {
  long long n;
  string s;
  cin >> n >> s;
  long long count1, count0;
  count0 = count1 = 0;
  for (long long i = 0; i < n; i++) {
    if (s[i] == '0') {
      count0 += 1;
    } else {
      count1 += 1;
    }
  }
  long long diff = count1 - count0;
  long long answer = abs(diff);
  cout << answer << endl;
  return 0;
}
