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