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