#include<cstdio>
#include<iostream>
using namespace std;
const int N=3010;
int main()
{
int a[N] = {1};
int n;
cin >> n;
int m=1;
for(int t=0;t<n;t++)
{
int x=0;
for(int j=0;j<m;j++)
{
x += a[j]*2;//模拟竖式运算
a[j] = x%10;//原来位数值得改变
x /= 10;
}
if(x) a[m++]=1;//判断是否需要进一位
}
for(int q=m-1;q>=0;q--)//从m-1开始时因为上面有m++,最后一位数在m-1那里
cout<<a[q];
return 0;
}