#include<bits/stdc++.h>
using namespace std;
int main(){
	int m,a,b,c,x;
	cin>>m;
	a=m%10;
	b=m/10%10;
	c=m/100;
	x=a+b+c;
	cout<<x;
	
}

/**************************************************************
	Problem: 1733
	User: zhengzihao3
	Language: C++
	Result: Accepted
	Time:8 ms
	Memory:2072 kb
****************************************************************/