#include #include #include char buf [102]; int main() { scanf("%s", buf); std::string s = buf; printf("%d\n", s.length() > 1 && std::all_of(++s.begin(), s.end(), [](const char &c){ return c == '3'; }) ? int(s.length() - 1) : -1); }