#include<iostream>
#include<cstdio>
using namespace std;
typedef long long LL;
void solve(LL x);
LL x;
int main()
{
cin>>x;
solve(x);
return 0;
}
void solve(LL x)
{
LL pre=x>>16;//pre=00000..0000-xxxxxxx
LL later=x-(pre<<16)<<16;
cout<<pre+later<<endl;
}