import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        while (in.hasNextInt()) {
            int a = in.nextInt();
            int b = 0;  // 存储翻转后的数字
            int temp = a;
            while (temp > 0) {
                b = b * 10 + temp % 10;  // 取最后一位,加到 b 上
                temp /= 10;  // 去掉最后一位
            }
            System.out.println(a + b);
        }
    }
}