#include <bits/stdc++.h>
using namespace std;
int main() {
  char a[200000 + 1];
  for (int i = 0; i < int(200000 + 1); i++) a[i] = 0;
  int n, k;
  int x, y, z;
  int s, ans;
  bool v = true;
  ans = 0;
  scanf("%d", &n);
  scanf("%s", a);
  x = 0;
  y = 0;
  for (int i = 0; i < int(n); i++) {
    if (a[i] == '0')
      x++;
    else
      y++;
  }
  ans = min(x, y) * 2;
  printf("%d\n", ans);
  return 0;
}
