#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
int main() {
  int n, a, b;
  string s;
  cin >> n >> s;
  for (int i = 0; i < n; i++) {
    if (s[i] == '0')
      a++;
    else
      b++;
  }
  cout << n - abs(a - b) << endl;
}
