#include <bits/stdc++.h>
const long long OO = 1e9;
const double EPS = (1e-7);
using namespace std;
const int mxN = 101;
int arr[mxN][3];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  long long n;
  cin >> n;
  string s;
  cin >> s;
  long long ones = 0;
  long long zeros = 0;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == '0')
      zeros++;
    else
      ones++;
  }
  cout << abs(ones - zeros) << "\n";
  return 0;
}
