#include <bits/stdc++.h>
int main() {
  char s[100000];
  scanf("%s", s);
  int count = 0;
  int n = strlen(s);
  int i, j, y = 0;
  int flag;
  while (1) {
    flag = 0;
    for (i = 0; i < n - y - 1; i++) {
      if (s[i] == '1') {
        if (s[i + 1] == '0') {
          count++;
          flag = 1;
        }
      } else {
        if (s[i + 1] == '1') {
          count++;
          flag = 1;
        }
      }
      if (flag) {
        for (j = i; j < n - y; j++) s[j] = s[j + 2];
        y += 2;
        break;
      }
    }
    if (flag == 0) break;
  }
  printf("%d\n", count * 2);
  return 0;
}
