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