#include <bits/stdc++.h> using namespace std; int main(){ int a,h=0,g; cin>>a; while(a!=0){; g=a%10; h+=g; a=a/10; } cout<<h<<endl; }