#include<bits/stdc++.h>
using namespace std;
int main(){
	int q,w,e,r,t;
	cin>>q;
	w=q%10;
	e=q/10%10;
	r=q/100%10;
	t=q/1000;
	cout<<q+w+e+r+t;
}
/**************************************************************
	Problem: 1617
	User: wangyiyang
	Language: C++
	Result: Accepted
	Time:10 ms
	Memory:2072 kb
****************************************************************/