#include using namespace std; #ifdef LOCAL #include "settings/debug.cpp" #else #define Debug(...) void(0) #endif #define rep(i, n) for (int i = 0; i < (n); ++i) using ll = long long; using ull = unsigned long long; int main() { ll n; cin >> n; function f = [&](ll x) { if (x < 10) return 0LL; string s = to_string(x); ll t = 1; for (char c : s) t *= c - '0'; return f(t) + 1; }; cout << f(n) << endl; return 0; }