//C
#include <stdio.h>
#define N 9
int arr[N];
int rev(int p){
int res= 0,pow = 1;
int i = 0,j = 0, n = p> 0 ? p:-p;
while(n % 10 == 0) n /= 10;
while(n > 0){
arr[i++] = n%10;
n /= 10;
}
while(i-- >= 0){
res = res + arr[i]*pow;
pow *= 10;
}
res = p > 0? res : -res;
return res;
}
int main(){
int num;
scanf("%d",&num);
printf("%d",rev(num));
return 0;
}