#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int count = 0;
  string s;
  cin >> n >> s;
  vector<char> c(n);
  for (int i = 0; i < n; i++) {
    c[i] = s.at(i);
    if (c[i] == '0') {
      count++;
    }
  }
  cout << 2 * min(count, n - count);
}
