#include
#include<stdlib.h>
using namespace std;
int main()
{
int ans=0,count=0,n;
cin>>n;
int temp=n;
while(n!=0)
{
n=n%10;
n=n/10;
count+=1;
}
while(temp!=0)
{
int val=temp%10;
temp=temp/10;
for(int i=count;;i--) // difficulty here. How to
{ make it work for reversing?
for(int j=1;j<=i;i++)
{
val=10*val;
}
break;
}
ans=ans+val;
}
cout<<ans<<endl;
return 0;
}