#include <bits/stdc++.h>
using namespace std;
vector<long long> v1[1000100];
vector<long long> v2;
map<long long, long long> m1;
map<long long, long long> m2;
map<long long, long long> m3;
map<char, long long> ms1;
map<string, long long> ms2;
stack<long long> sta;
long long mod = 1e8;
long long dp[105][105][15][15];
long long big = 999999999999999999, small = -999999999999999999;
long long z, y, x, n, m, i, j, k, t, l, ans, sum1, sum2, avg, test,
    mx = small, mn = big, b[1000100], c[1000100], a[1001000], d[1000100],
    co1[1000100], co2[1001000];
char s1[100010], s2[100100], s3[1000100], temp;
string s[101010];
bool ok[1000100], ok1, ok2;
char rl, a1[11] = {'q', 'w', 'e', 'r', 't', 'y', 'u', 'i', 'o', 'p'},
         a2[11] = {'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', ';'},
         a3[10] = {'z', 'x', 'c', 'v', 'b', 'n', 'm', ',', '.', '/'};
bool so(string a, string b) { return a + b < b + a; }
int main() {
  cin >> n >> s1;
  for (i = 0; i < n; i++) co1[s1[i] - '0']++;
  cout << fabs(co1[0] - co1[1]);
  return 0;
}
