#include <algorithm>
#include <iostream>
#include <iterator>
#include <string>
using namespace std;

int main() {
    int a;
    cin>>a;
    string s=to_string(a);//转成字符串
    reverse(s.begin(),s.end());//反转
    int c=stoi(s);//转成int
    cout << (a + c) << endl;
}