#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  int cntz = 0;
  int cnto = 0;
  for (int i = 0; i < N; i++) {
    char a;
    cin >> a;
    if (a == '0') cntz++;
    if (a == '1') cnto++;
  }
  int ans = 2 * min(cntz, cnto);
  cout << ans;
}
