#include #define int long long using namespace std; signed main(){ int N; cin>>N; int n=N; while(n>=10){ int cnt=0; for(int i=n;i>0;i/=10)cnt+=i%10; n=cnt; } cout<