// I need sum of square digits from give numbers until single digitls
//Example 125
// 1*1+2*2+5*5
// 30
//3*3+0
//9
1+4+25
Public static Void Main()
{
int number;
int result=0;
number =int32.Parse(Console.ReadLine());
if(result !=1)
{
While(number!-0)
{
r =number%10;
sum = sum + r;
number =number /10
}
result =sum;
number=sum;
Console.WriteLine(sum);
}
}
// by using method i am getting as 30