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