import java.util.Scanner;

// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
         int a = sc.nextInt(); 
        int b = reverseNumber(a);
        int result = a + b;
        System.out.println(result);
}
   public static int reverseNumber(int num) {
        int reversed = 0;
        while (num != 0) {
            int digit = num % 10; // 获取最后一位数字
            reversed = reversed * 10 + digit; // 将该数字添加到反转后的数字中
            num /= 10; // 去掉最后一位数字
        }
        return reversed;
    }
}