#The Biggest Water Problem#
#include<stdio.h>
int main() {//暴力解
long a;
scanf("%ld",&a);
do{
long sum=0;//存放“变身“后的数
while (a!=0)
{
sum+=a%10;
a/=10;
}
a=sum; //相当于一个递归
} while (a>9);
printf("%ld",a);
return 0;
}
