#include <bits/stdc++.h>
using namespace std;
char a[100020];
int x[100020];
int main() {
  int n, m, t, k, i, j;
  int sum = 0;
  scanf("%s", a);
  n = strlen(a);
  for (i = 0; i < n; i++) {
    if (a[i] == '0')
      x[i + 1] = 0;
    else
      x[i + 1] = 1;
  }
  while (1) {
    int a1 = 0;
    int a2 = 0;
    for (i = 1; i <= n; i++) {
      if (x[i] == 1) a1++;
      if (x[i] == 0) a2++;
    }
    if (a1 == n || a2 == n) break;
    for (i = 1; i < n; i++) {
      if ((x[i] == 0 && x[i + 1] == 1) || (x[i] == 1 && x[i + 1] == 0)) {
        sum += 2;
        n = n - 2;
        for (j = i; j <= n; j++) x[j] = x[j + 2];
      }
    }
  }
  printf("%d\n", sum);
  return 0;
}
