#include<bits/stdc++.h>
using namespace std;
int main(){
	int x,s,g,sh,b,q,w;
	cin>>x;
	g=x%10;
	sh=x/10%10;
	b=x/100%10;
	q=x/1000%10;
	w=x/10000;
	s=g+sh+b+q+w;
	cout<<s;
    
}
/**************************************************************
	Problem: 1418
	User: wangyiyang
	Language: C++
	Result: Accepted
	Time:19 ms
	Memory:2072 kb
****************************************************************/