#include <bits/stdc++.h>
int main() {
  int count = 0;
  std::string S;
  std::cin >> S;
  for (int i = 10; i >= 1; i--) {
    std::string s = "0{";
    s += std::to_string(i);
    s += "}1{";
    s += std::to_string(i);
    s += "}|1{";
    s += std::to_string(i);
    s += "}0{";
    s += std::to_string(i);
    s += "}";
    std::regex r = std::regex(s);
    std::string buf = "";
    while (S != buf) {
      buf = S;
      S = std::regex_replace(S, r, "");
      count += (buf.size() - S.size());
    }
  }
  std::cout << count << std::endl;
  return 0;
}
