https://www.acmicpc.net/problem/1110
import java.util.Scanner;
public class Main {
static int change(int n){
int a=n/10;
int b=n%10;
int c=a+b;
return b*10+c%10;
}
public static void main(String args[]) {
Scanner s=new Scanner(System.in);
int n=s.nextInt();
int t=1;
int num=change(n);
if(n==0) System.out.print(1);
else{
while(true){
num=change(num);
t++;
if(num==n){
System.out.print(t);
break;
}
}
}
}
}