#include <bits/stdc++.h>
int main(void) {
  static char str[100000], strc[100000];
  int flag = 0, n;
  int cnt = 0;
  int i, j, k;
  scanf("%s", str);
  n = strlen(str);
  strcpy(strc, str);
  while (1) {
    flag = 0;
    for (i = 0; i + 1 < n; i++) {
      j = i + 1;
      if (strc[i] == '0' && strc[j] == '1') {
        flag = 1;
        strc[i] = strc[j] = 'x';
        cnt += 2;
      }
      if (strc[i] == '1' && strc[j] == '0') {
        flag = 1;
        strc[i] = strc[j] = 'x';
        cnt += 2;
      }
    }
    for (i = 0, j = 0; i < n; i++) {
      if (strc[i] != 'x') {
        strc[j] = strc[i];
        j++;
      }
    }
    strc[j] = '\0';
    n = j;
    if (flag == 0) {
      break;
    }
  }
  printf("%d", cnt);
  return 0;
}
