#include<iostream> using namespace std; int main(){ int n; cin>>n; int t=n,s=0; while(t){ s+=t%10; t/=10; } cout<<s; }