#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, z = 0, o = 0;
  cin >> n;
  string s;
  cin >> s;
  for (int i = 0; i < s.length(); i++) {
    if (s[i] == '0')
      z++;
    else
      o++;
  }
  cout << 2 * min(z, o) << endl;
}
