#include<bits/stdc++.h> using namespace std; int main(){ int n; long long s=0; cin>>n; while(n!=0){ s+=n%10; n=n/10; } cout<<s; return 0; }