#include<bits/stdc++.h>
using namespace std;
int main(){
int a,b,c,d,e,f,g;
cin>>a;
b=a%10;
c=a/10%10;
d=a/100%10;
e=a/1000%10;
f=b+c+d+e;
g=a+f;
printf("%d",g);
}
/**************************************************************
Problem: 1617
User: toughuatao1
Language: C++
Result: Accepted
Time:8 ms
Memory:2072 kb
****************************************************************/