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