public class testxf {
public static void main(String[] args) {
Scanner sin =new Scanner(System.in);
int a = sin.nextInt();
int temp = a;
int a_1 = 0;
while (temp>0){
a_1=a_1*10+temp%10;
temp/=10;
}
int result = a_1+a;
System.out.println(result);
}
}
public class Main{ public static void main(String[] args) { Scanner sc = new Scanner(System.in); int num = sc.nextInt(); String n = String.valueOf(num); int flag = n.length()-1; while(n.charAt(flag)=='0'&&flag!=0){ flag--; } String result = ""; for(;flag>=0;flag--){ result += n.charAt(flag); } int sum = num + Integer.parseInt(result); System.out.println(sum); } }