#include <bits/stdc++.h>
using namespace std;
int dem=0;
void sogoc(long long n)
{
	long long a=n, b=1, c;
	if (n/10!=0) 
	{
		while (a/10!=0)
		{
			b=b*(a%10);
			a=a/10;
		}
		dem++;
		sogoc(b);
	}
}
int main ()
{
	freopen ("SOGB.inp", "r", stdin);
	freopen ("SOGB.out", "w", stdout);
	long long n;
	cin >> n;
	sogoc (n);
	cout << dem;
}
