https://www.acmicpc.net/problem/1110
using System;
class Program
{
static int change(int n){
int a=n/10;
int b=n%10;
int c=a+b;
return b*10+c%10;
}
static void Main() {
string arr=Console.ReadLine();
int n=int.Parse(arr);
int t=1;
int num=change(n);
if(n==0) Console.Write("1");
else{
while(true){
num=change(num);
t++;
if(num==n){
Console.Write(t);
break;
}
}
}
}
}