import java.util.Scanner;
public class P1110 {
public static void main(String[] args) {
int n;
int temp;
int count = 0;
int sum = 0;
Scanner sc = new Scanner(System.in);
n = sc.nextInt();
temp = n;
while (true) {
if (n <= 9) {
sum = n;
n = sum * 10 + sum;
count++;
} else if (n >= 9) {
sum = n / 10 + n % 10;
n = (n % 10) * 10 + (sum % 10);
count++;
}
if (temp == n) {
break;
}
}
System.out.println(count);
sc.close();
}
}