#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  int n;
  string str;
  cin >> n;
  cin >> str;
  int zeros = 0, ones = 0;
  for (int i = 0; i < n; i++)
    if (str[i] == '0')
      zeros++;
    else
      ones++;
  cout << abs(ones - zeros) << "\n";
  return 0;
}
