The Biggest Water Problem
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
ll n;
cin>>n;
ll sum=0;
while(n>10){
ll sum=n;
ll d=0;
while(sum){
d+=sum%10;
sum/=10;
}
n=d;
}
cout<<n;
return 0;
}