#include <bits/stdc++.h>
int main() {
  std::string S;
  std::cin >> S;
  int N = S.length();
  int val1 = int(S[0]) - int('0');
  int val2, val3;
  int counter = 1;
  int ans = 0;
  while (counter <= N - 1) {
    val2 = int(S[counter]) - int('0');
    if (counter <= N - 2) {
      val3 = int(S[counter + 1]) - int('0');
    }
    if (val1 + val2 == 1) {
      val1 = val3;
      ans += 2;
      counter += 2;
    } else if (counter <= N - 2 && val2 + val3 == 1) {
      ans += 2;
      counter += 2;
    } else {
      val1 = val3;
      counter += 2;
    }
  }
  printf("%d\n", ans);
  return 0;
}
