Little Petya wanted to give an April Fools Day present to some scientists. After some hesitation he decided to give them the array that he got as a present in Codeforces Round #153 (Div.2). The scientists rejoiced at the gift and decided to put some important facts to this array. Here are the first few of the facts: The highest mountain above sea level in the world is Mount Everest. Its peak rises to 8848 m.  The largest board game tournament consisted of 958 participants playing chapaev. The largest online maths competition consisted of 12766 participants. The Nile is credited as the longest river in the world. From its farthest stream in Burundi, it extends 6695 km in length. While not in flood, the main stretches of the Amazon river in South America can reach widths of up to 1100 km at its widest points. Angel Falls is the highest waterfall. Its greatest single drop measures 807 m. The Hotel Everest View above Namche, Nepal — the village closest to Everest base camp – is at a record height of 31962 m Uranium is the heaviest of all the naturally occurring elements. Its most common isotope has a nucleus containing 146 neutrons. The coldest permanently inhabited place is the Siberian village of Oymyakon, where the temperature of -68°C was registered in the twentieth century. The longest snake held in captivity is over 25 feet long. Its name is Medusa. Colonel Meow holds the world record for longest fur on a cat — almost 134 centimeters. Sea otters can have up to 10000 hairs per square inch. This is the most dense fur in the animal kingdom. The largest state of USA is Alaska; its area is 663268 square miles Alaska has a longer coastline than all of the other 49 U.S. States put together: it is 154103 miles long. Lake Baikal is the largest freshwater lake in the world. It reaches 1642 meters in depth and contains around one-fifth of the world’s unfrozen fresh water. The most colorful national flag is the one of Turkmenistan, with 106 colors.

The input will contain a single integer between 1 and 16.

#include <cstdio>
char sentence[10086]="1001010111001010";
int main()
{
    int a;
    scanf("%d",&a);
    printf("%c\n",sentence[a-1]);
    return 0;
}

#include<iostream>
using namespace std;
int main()
{
    int i;
    cin>>i;
    if(i==1||i==4||i==6||i==8||i==9||i==10||i==13||i==15) cout<<1;
    else cout<<0;
    return 0;
}

#include <cstdio>
char s[] = "1001010111001010";
int main()
{
    int n;
    scanf("%d", &n);
    printf("%c\n", s[n-1]);
    return 0;
}

#include<iostream>
#include<cstdio>
using namespace std;
int h[17]={0,1,0,0,1,0,1,0,1,1,1,0,0,1,0,1,0},n;
int main()
{
	scanf("%d",&n);
	printf("%d",h[n]);
	return 0;
}

#include <bits/stdc++.h>
using namespace std;
const int maxn=20;
int s[maxn]={0,1,0,0,1,0,1,0,1,1,1,0,0,1,0,1,0};
int main(){
    int n;
    scanf("%d",&n);
    printf("%d",s[n]);
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
char c[100]="1001010111001010";
int a;
int main()
{
    cin>>a;
    cout<<c[a-1]<<endl;
    return 0;
}

#include <cstdio>
char s[] = "1001010111001010";
int main() {
    int n;
    scanf("%d", &n);
    printf("%c\n", s[n-1]);
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
char s[]="1001010111001010";
int main()
{
    int n;
    cin>> n;
    cout<<s[n-1]<<endl;
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
char s[20]="1001010111001010";
int main()
{
    int n;
    cin>>n;
    cout<<s[n-1];
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
string a="1001010111001010";
int main(){
	int i;
	cin>>i;
	cout<<a[i-1];
}

#include <iostream>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
using namespace std;
int main(){
  vector<int> A(16, 1);
  A[1] = 0;
  A[2] = 0;
  A[4] = 0;
  A[6] = 0;
  A[10] = 0;
  A[11] = 0;
  A[13] = 0;
  A[15] = 0;
  int a;
  cin>>a;
  a--;
  cout<<A[a]<<endl;
  return 0;
}

// luogu-judger-enable-o2
#include <cstdio>
char s[] = "1001010111001010";
int main()
{
    int n;
    scanf("%d", &n);
    printf("%c\n", s[n-1]);
    return 0;
}

#define _CRT_SECURE_NO_WARNINGS
#include <cstdlib>
#include <fstream>
#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <vector>
#include <cmath>
#include <set>
#include <map>
#include <queue>
#include <deque>
#include <cstring>
#include <ctime>
#include <sstream>

#define ll long long
#define ld long double
#define pii pair<int,int>
#define pll pair<ll,ll>
#define mp make_pair
#define vi vector<int>
#define vvi vector<vector<int> >
#define min(x,y) ((x < y)? x : y)
#define min3(x,y,z) (min(x,min(y,z)))
#define sqrt(x) pow(x,0.5)
#define sqr(x) (x * x)
#define endl "\n"
#define FILENAME 0
#define STDNAME 0
#define taskname ""

using namespace std;

const ll inf = 1000 * 1000 * 1000;
const ll mod = 1000 * 1000 * 1000 + 7;

int main(){
#if FILENAME
	freopen(taskname".in","r",stdin);
	freopen(taskname".out","w",stdout);
#elif STDNAME
	freopen("INPUT.TXT","r",stdin);
	freopen("OUTPUT.TXT","w",stdout);
#endif
	ios_base::sync_with_stdio(false);
	bool arr[17];
	arr[1] = true;//--
	arr[2] = false;//--
	arr[3] = false;//--
	arr[4] = true;//--
	arr[5] = false;//--
	arr[6] = true;//s;
	arr[7] = false;//--
	arr[8] = true;//--
	arr[9] = true;//s
	arr[10] = true;//--
	arr[11] = false;//s
	arr[12] = false;//s
	arr[13] = true;//--
	arr[14] = false;//s
	arr[15] = true;//s
	arr[16] = false;//--
	int n;
	cin >> n;
	//if(n == 4)
	//	while(true);
	int ans = arr[n];
	cout << ans;
	return 0;
}

#include<map>
#include<list>
#include<cmath>
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#define in inline
#define ri register int
using namespace std;
int a[]{0,1,4,6,8,9,10,13,15},n;
int main(){
    scanf("%d",&n);
    for(ri i=1;i<=8;i++)
        if(n==a[i]){
            putchar('1');
            return ~~(0-0);//卖个萌求通过
        }
    putchar('0');
    return ~~(0-0);
}

#include<iostream>
char s[]="1001010111001010";
int main(){
    int n;
    std::cin>>n;
    std::cout<<s[n-1];
}

#include<bits/stdc++.h>
using namespace std;
template<typename T>inline void read(T &x){
    long long f=1;x=0;char ch=getchar();
    while(!isdigit(ch)){
        if(ch=='-')f=-1;
        ch=getchar();
    }
    while(isdigit(ch)){
        x=(x<<1)+(x<<3)+(ch^'0');
        ch=getchar();
    }
    x*=f;
}
template<typename T>inline void write(T x){
    if(x<0){
        x=-x;
        putchar('-');
    }
    if(x>9)write(x/10);
    putchar(x%10+'0');
}
template<typename T>inline void writeln(T x){
    write(x);
    putchar('\n');
}
int a[]={0,1,0,0,1,0,1,0,1,1,1,0,0,1,0,1,0};
int main(){
//	freopen(".in","r",stdin);
//	freopen(".out","w",stdout);

	int n;
	read(n);
	writeln(a[n]);
    return 0;
}

#include<bits/stdc++.h>
#define itn int
#define For(a,b,c,t)  for(ri a=b;a<=c;a+=t)
#define Memset(a,b)  memset(a,b,sizeof(a))
#define ri register int
#define il inline long long
#define li long long
using namespace std;
itn ans[17]={0,1,0,0,1,0,1,0,1,1,1,0,0,1,0,1,0};
int main()
{
	itn n;
	scanf("%d",&n);
	printf("%d",ans[n]);
	return 0;
}

#include <iostream>

using namespace std;

int n;

int main()
{
    cin >> n;
    if(n==13 || n==8 || n==1 || n==10 || n==9 || n==15 || n==4 || n==6)
    {
        cout << "1" << endl;
    }
    else{
        cout << "0" << endl;
    }
    return 0;
}

#include <iostream>

using namespace std;

int a[16] = { 1, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 1, 0, 1, 0 }, n;

int main() {
    cin >> n;
    cout << a[n - 1] << endl;
    return 0;
}

#include <iostream>
using namespace std;
int main() {
    int n;
    cin >> n;
    if (n == 1 || n == 4 || n == 6 || n == 8 || n == 9 || n== 10 || n== 13 || n ==15) cout << "1" << endl;
    else cout << "0" << endl;
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
string str="01001010111001010";
int n;
int main()
{
    cin>>n;
    cout<<str[n];
}

#include <bits/stdc++.h>
using namespace std;
int n;
char s[] = "1001010111001010";
int main()
{
    cin>>n;
    printf("%c\n", s[n-1]);
    return 0;
}

#include <bits/stdc++.h>

using namespace std;
long long n;
int main()
{
    cin>>n;
    if(n == 1 || n == 4 || n == 6 || n == 8 || n == 9 || n == 10 || n == 13 || n == 15) cout<<1<<endl;
    else cout<<0<<endl;
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin>>n;
if(n==1||n==4||n==6||n==8||n==9||n==10||n==13||n==15)cout<<1;
else cout<<0;
}

#include <bits/stdc++.h>
#define ll long long
using namespace std;
const ll N=200005;
ll n;
bool check[N]={0,1,0,0,1,0,1,0,1,1,1,0,0,1,0,1,0};
int main()
{
    cin>>n;
    cout<<check[n]<<endl;
    return 0;
}

#include <cstdio>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <utility>
#include <vector>
#include <cwchar>
#include <cwctype>
#include <complex.h>
#include <fenv.h>
#include <inttypes.h>
#include <stdbool.h>
#include <stdint.h>
#include <tgmath.h>
#include<bits/stdc++.h>
#include <assert.h>
#include<bits/stdc++.h>
#include <assert.h>
#include <ctype.h>
#include <errno.h>
#include <float.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <wchar.h>
#include <wctype.h>
#include <algorithm>
#include <bitset>
#include <cctype>
#include <cerrno>
#include <clocale>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <limits>
#include <list>
#include <map>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <utility>
#include <vector>
#include <cwchar>
#include <cwctype>
#include <complex.h>
#include <fenv.h>
#include <inttypes.h>
#include <stdbool.h>
#include <stdint.h>
#include <tgmath.h>
#include <ctype.h>
#include <errno.h>
#include <float.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <wchar.h>
#include <wctype.h>
#include <algorithm>
#include <bitset>
#include <cctype>
#include <cerrno>
#include <clocale>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <limits>
#include <list>
#include <map>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <utility>
#include <vector>
#include <cwchar>
#include <cwctype>
#include <complex.h>
#include <fenv.h>
#include <inttypes.h>
#include <stdbool.h>
#include <stdint.h>
#include <tgmath.h>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <utility>
#include <vector>
#include <cwchar>
#include <cwctype>
#include <complex.h>
#include <fenv.h>
#include <inttypes.h>
#include <stdbool.h>
#include <stdint.h>
#include <tgmath.h>
#include <ctype.h>
#include <errno.h>
#include <float.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <wchar.h>
#include <wctype.h>
#include <algorithm>
#include <bitset>
#include <cctype>
#include <cerrno>
#include <clocale>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <limits>
#include <list>
#include <map>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <ostream>
char c[] = "1001010111001010";
int main()
{
    int n;
    scanf("%d", &n);
    printf("%c\n", c[n-1]);
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
int a;
int main(){
	cin>>a;
	if(a==1 || a==4 || a==6 ||a==8 || a==9 || a==10 || a==13 || a==15) cout<<1;
	else cout<<0;
}

#include<bits/stdc++.h>
using namespace std;
int a[17] = {0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 1, 0, 1, 0};
int xcy;
int main(){
    scanf("%d", &xcy);
    printf("%d", a[xcy]);
    return 0;
}

#include<cstdio>
char a[]="01001010111001010";
int main(){
	int n=0;char c=getchar();
	while(c<58&&c>47)	n=n*10+c-48,c=getchar();
	putchar(a[n]);
	return 0;
}

#include<cstdio>
char s[]="01001010111001010";
int main()
{
    int n;
    scanf("%d",&n);
    printf("%c\n",s[n]);
    return 0;
}

#include <iostream>
#include <fstream>
#include <ctime>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cassert>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <string>
#include <queue>
#include <deque>
#include <list>

using namespace std;

#define pb push_back
#define fs first
#define sc second
#define sz(a) (int)a.size()
#define szs(s) (int)s.length()
#define elif else if
#define mp make_pair

typedef long long ll;
typedef long double ld;

const int INF = 1000000009;
const ll INFL = 1000000000000000009ll;
const ld eps = 1e-9;

#define NAME ""

int a[17];

int main()
{
    #ifdef _GEANY
    freopen("input.txt", "r", stdin);
    #endif
    int i;
    a[1] = 1;//*
    a[2] = 0;
    a[3] = 0;//*
    a[4] = 1;//*
    a[5] = 0;
    a[6] = 1;//*
    a[7] = 0;//*
    a[8] = 1;//*
    a[9] = 1;//*
    a[10] = 1;
    a[11] = 0;//*
    a[12] = 0;
    a[13] = 1;//*
    a[14] = 0;    //15-16
    a[15] = 1;//*
    a[16] = 0;//*
    cin >> i;
    cout << a[i];
    return 0;
}

#include<iostream>
#include<cstdio>
using namespace std;
char s[]="1001010111001010";
int main()
{
    int n;
    scanf("%d", &n);
    printf("%c\n", s[n-1]);
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
bool f[]={0,1,0,0,1,0,1,0,1,1,1,0,0,1,0,1,0};
int main()
{
    int x;
    scanf("%d",&x);
    printf("%d",f[x]);
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
long long n;
int main()
{
	cin>>n;
	if(n==1||n==4||n==6||n==8||n==9||n==10||n==13||n==15) cout<<"1";
	else cout<<"0";

	return 0;
}

#include<map>
#include<list>
#include<cmath>
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#define in inline
#define ri register int
using namespace std;
int a[]{0,1,4,6,8,9,10,13,15},n;
int main(){
   cin>>n;
    for(ri i=1;i<=8;i++)
        if(n==a[i]){
            putchar('1');
            return 0;
        }
    putchar('0');
    return 0;
}

#include <iostream>
using namespace std;
int n;
char s[20]="01001010111001010";
int main()
{
	cin>>n;
	cout<<s[n];
	return 0;
}

#include <iostream>
using namespace std;
int a[17]={0,1,0,0,1,0,1,0,1,1,1,0,0,1,0,1,0},n;
int main()
{
    cin>>n;
    cout<<a[n];
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
    string s="1001010111001010";
    int n;
    cin>>n;
    cout<<s[n-1];
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
string st="1001010111001010";
int n;
int main()
{
    cin>>n;
    cout<<st[n-1]<<endl;
    return 0;
}

#include <iostream>
using namespace std;
char arrAns[] = "1001010111001010";
int main(){
    int n;
    cin>>n;
    cout<<arrAns[n-1];
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
char s[] = "01001010111001010";
int main()
{
	int n;
	cin>>n;
	cout<<s[n];
 	return 0;
}

// luogu-judger-enable-o2
#include <iostream>
using namespace std;
int main()
{
    int i;
    cin>>i;
    if(i==1||i==4||i==6||i==8||i==9||i==10||i==13||i==15)
    cout<<1<<endl;
    else cout<<0<<endl;
}

#include<iostream>
#include<cstring>
#include<cstdio>
#include<algorithm>
#include<cmath>
using namespace std;
int main(){
	int n;
	char s[] = "1001010111001010";
	cin>>n;
	cout<<s[n-1];
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int a[16]={1,0,0,1,0,1,0,1,1,1,0,0,1,0,1,0};
    int n;
    cin>>n;
    cout<<a[n-1];
    return 0;
}

#define F_in(s) freopen(s".in","r",stdin)
#define F_out(x) freopen(x".out","w",stdout)
#define lal long long int
#include<algorithm>
#include<iostream>
#include<cstring>
#include<cstdio>
#include<cmath>
using namespace std;
char s[]="1001010111001010";
int main()
{
    int n;
    cin>>n;
    cout<<s[n-1]<<endl;
    return 0;
}

//CF409D
#include<bits/stdc++.h>
using namespace std;
char a[17]="1001010111001010";
int main(){
	int n;
	cin>>n;
	cout<<a[n-1]<<endl;
	return 0;
}

#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<stdio.h>
#include<algorithm>
#include<vector>
#include<queue>
#include<cmath>
#include<list>
#include<string>
#include<set>
#include<map>
#include<iomanip>
#include<sstream>
#include<string.h>
#include<math.h>
#include<deque>
#define eps 1e-9
using namespace std;

int main(){
 bool ans[16] = { 1, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 1, 0, 1, 0 };
 int a;
 cin >> a;
 cout << (ans[a - 1] == 1) ? 1 : 0;
 cout << endl;
 return 0;
}

#include <bits/stdc++.h>
#define int long long
using namespace std;

signed main(){
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	vector<int> v={1,0,0,1,0,1,0,1,1,1,0,0,1,0,1,0};
	int n;
	cin >> n;
	cout << v[n-1];
	return 0;
}

#include<iostream>
#include<cstdio>
using namespace std;
int main(){
	int n;
	cin>>n;
	string x="1001010111001010";
	cout<<x[n-1];
}

#include <iostream>
using namespace std;
int s[17]={0,1,0,0,1,0,1,0,1,1,1,0,0,1,0,1,0};
int main() {
    int n;
    cin>>n;
    cout<<s[n];
    return 0;
}

#include<cstdio>
char s[]="1001010111001010";
int main()
{
	int n;scanf("%d",&n);
	putchar(s[n-1]);
	return 0;
}

#include<bits/stdc++.h>
char ans[20]="1001010111001010";
int n;
int main()
{
	scanf("%d",&n);
	printf("%c",ans[n-1]);
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin>>n;
if(n==1||n==4||n==6||n==8||n==9||n==10||n==13||n==15) cout<<1;
else cout<<0;
}

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <vector>
#include <map>
#include <set>
#include <cmath>
#include <queue>
#include <string>
#include <cstring>
#include <algorithm>

#define forn(i, n) for (int i = 0; i < (int)(n); ++i)

using namespace std;

typedef long long ll;
typedef pair<int, int> ii;

int gcd(int a, int b) {
   return b ? gcd(b, a % b): a;
}

int main()
{
   int ans[] = {
     1, 0, 0, 1,
     0, 1, 0, 1,
     1, 1, 0, 0,
     1, 0, 1, 0,
   };
   int x;
   cin >> x;
   cout << ans[x - 1] << endl;
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
long long n;
int main()
{
    cin>>n;
    if(n==1) cout<<1;
	if(n==2) cout<<0;
	if(n==3) cout<<0;
	if(n==4) cout<<1;
	if(n==5) cout<<0;
	if(n==6) cout<<1;
	if(n==7) cout<<0;
	if(n==8) cout<<1;
	if(n==9) cout<<1;
	if(n==10) cout<<1;
	if(n==11) cout<<0;
	if(n==12) cout<<0;
	if(n==13) cout<<1;
	if(n==14) cout<<0;
	if(n==15) cout<<1;
	if(n==16) cout<<0;
    cout<<endl;
    return 0;
}

#include<iostream>
using namespace std;
int main()
{
    int i;
    cin>>i;
    if(i==1||i==4||i==6||i==8||i==9||i==10||i==13||i==15) cout<<1;
    else cout<<0;
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
int a[16]={1,0,0,1,0,1,0,1,1,1,0,0,1,0,1,0};
int main(){
	int n;
	cin>>n;
	cout<<a[n-1]<<endl;
	return 0;
}

#include<cstdio>
using namespace std;
int main(){
	int n;
	scanf("%d",&n);
	if(n==1||n==4||n==6||n==8||n==9||n==10||n==13||n==15)
		printf("1");
	else
		printf("0");
	return 0;
}

#include <bits/stdc++.h>
using namespace std;
int ans[]={0,1,0,0,1,0,1,0,1,1,1,0,0,1,0,1,0};
int main(){
    int n;
    scanf("%d",&n);
    printf("%d",ans[n]);
    return 0;
}

#include <iostream>
using namespace std;
int main(){
    int i;
    cin>>i;
    if(i==1||i==4||i==6||i==8||i==9||i==10||i==13||i==15) cout<<1;
    else cout<<0;
}

#include <cstdio>
#include <set>
#include <map>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>
#include <cstring>
#include <cstdlib>
#include <iostream>
using namespace std;

int val[]={1,0,0,1,0,1,0,1,1,1,0,0,1,0,1,0};

int main(){
	int n;
	scanf("%d", &n);
	printf("%d\n", val[n-1]);
	return 0;
}

#include<queue>
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;
char s[]="1001010111001010";
int n;
int main()
{
	scanf("%d",&n);
	printf("%c\n",s[n-1]);
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
char s[]="1001010111001010";
int main()
{
    int n;
    scanf("%d", &n);
    printf("%c\n", s[n-1]);
    return 0;
}

#include<iostream>
using namespace std;

int a[]={0,1,0,0,1,0,1,0,1,1,1,0,0,1,0,1,0};

int main()
{
	int n;cin>>n;
	cout<<a[n]<<endl;
	return 0;
}

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

int main()
{
    int a;
    cin>>a;

    if (a==1 || a==4 || a==6 || a==8 || a==9 || a==10 || /*a==12 ||*/ a==13 || /*a==14 ||*/ a==15 )
    {
        cout<<1;
    }
    else
        cout<<0;
    return 0;
}

#include<bits/stdc++.h>
char a[]="01001010111001010";
int main()
{
	int n;scanf("%d",&n);
	putchar(a[n]);
	return 0;
}

#include<iostream>
#include<cstdio>
using namespace std;
char s[]="1001010111001010";
int main()
{
    int n;
    scanf("%d", &n);
    printf("%c\n", s[n-1]);
    return 0;
}

#include<bits/stdc++.h>
#define M(a,b) memset(a,b,sizeof(a))
#define maxn 200001
#define inf 0x7fffffff
using namespace std;
string s="1001010111001010";
inline int read(){
    char c=getchar();int num=0;bool b=0;
    for(;c<'0'||c>'9';b=(c=='-'?1:0),c=getchar());
    for(;c>='0'&&c<='9';num=(num<<3)+(num<<1)+(c^'0'),c=getchar());
    return b?-num:num;
}
int main(){
	cout<<s[read()-1];
	return 0;
}

#include<iostream>
using namespace std;
int a[]={1,0,0,1,0,1,0,1,1,1,0,0,1,0,1,0};
int main(){
    int n;
    cin>>n;
    cout<<a[n-1]<<endl;
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
char s[101] = "1001010111001010";
int main()
{
    int n;
    scanf("%d", &n);
    printf("%c\n", s[n-1]);
    return 0;
}

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
using namespace std;
int a[20]={0,1,0,0,1,0,1,0,1,1,1,0,0,1,0,1,0,0,0,0};
int n;
int main()
{
  scanf("%d",&n);
  printf("%d",a[n]);
 // system("pause");
  return 0;
}

#include<bits/stdc++.h>
char ans[20]="1001010111001010";
int n;
int main()
{
	scanf("%d",&n);
	printf("%c",ans[n-1]);
	return 0;
}

#include <cstdlib>
#include <cstring>
#include <memory>
#include <cstdio>
#include <fstream>
#include <iostream>
#include <cmath>
#include <string>
#include <sstream>
#include <stack>
#include <queue>
#include <vector>
#include <set>
#include <map>
#include <algorithm>
using namespace std;

typedef signed long long ll;

#undef _P
#define _P(...) (void)printf(__VA_ARGS__)

#define FOR(x,to) for(x=0;x<to;x++)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ZERO(a) memset(a,0,sizeof(a))
void _fill_int(int* p,int val,int rep) {int i;  FOR(i,rep) p[i]=val;}
#define FILL_INT(a,val) _fill_int((int*)a,val,sizeof(a)/4)
#define MINUS(a) _fill_int((int*)a,-1,sizeof(a)/4)
ll GETi() { ll i;scanf("%lld",&i); return i;}
//-------------------------------------------------------

void solve() {
    int f,i,j,k,l,x,y;
//  int R[]={1,0,0,0,0,0,0,1,0,1,0,1,1,0,0,0};
    int R[]={1,0,0,1,0,1,0,1,1,1,0,0,1,0,1,0};
////int R[]={o,0,0,d,9,x,o,1,b,a,7,e,1,x,c,6};
    cin>>x;
    cout << R[x-1] << endl;

}

int main(int argc,char** argv){
    string s;
    if(argc==1) ios::sync_with_stdio(false);
    for(int i=1;i<argc;i++) s+=argv[i],s+='\n';
    for(int i=s.size()-1;i>=0;i--) ungetc(s[i],stdin);
    solve();
    return 0;
}

#include<bits/stdc++.h>
using namespace std;

int n;

int main()
{
    scanf("%d",&n);
    switch(n){
        case 1:cout<<"1";break;
        case 2:cout<<"0";break;
        case 3:cout<<"0";break;
        case 4:cout<<"1";break;
        case 5:cout<<"0";break;
        case 6:cout<<"1";break;
        case 7:cout<<"0";break;
        case 8:cout<<"1";break;
        case 9:cout<<"1";break;
        case 10:cout<<"1";break;
        case 11:cout<<"0";break;
        case 12:cout<<"0";break;
        case 13:cout<<"1";break;
        case 14:cout<<"0";break;
        case 15:cout<<"1";break;
        case 16:cout<<"0";break;
    }
    return 0;
}

#include<iostream>
using namespace std;
int a[20]={1,0,0,1,0,1,0,1,1,1,0,0,1,0,1,0};
int main()
{
	int n;
	cin>>n;
	cout<<a[n-1];
	return 0;
}

#include<iostream>
#include<fstream>
#include<algorithm>
#include<string>
using namespace std;
int a;
int main()
{
     cin>>a;
     if(a==1||a==4||a==6||a==8||a==9||a==10||a==13||a==15)
     {
     	cout<<1<<' ';
     	return 0;
     }
     cout<<0<<' ';
}

#include<iostream>
#include<cstdio>
using namespace std;
int main(){
	int n;
	cin>>n;
	string x="1001010111001010";
	cout<<x[n-1];
}

#include <cstdio>
char s[] = "1001010111001010";
int main() {
    int n;
    scanf("%d", &n);
    printf("%c\n", s[n-1]);
    return 0;
}

#include <stdio.h>
#include <iostream>
using namespace std;
int a[17]={0,1,0,0,0,0,0,0,1,0,1,0,0,1,0,0,0};  //4
int main()
{
    int a1;
    cin>>a1;
    cout<<a[a1]<<endl;
}

//
//  main.cpp
//  April Fools Day Contest 2014 D
//
//  Created by luras on 16/3/16.
//  Copyright (c) 2016年 luras. All rights reserved.
//

#define ms(x, y) memset(x, y, sizeof(x))
#define mc(x, y) memcpy(x, y, sizeof(x))
#define ls o << 1
#define rs o << 1 | 1
#include<stdio.h>
#include<string.h>
#include<math.h>
#include<queue>
#include<map>
#include<stack>
#include<vector>
#include<list>
#include<set>
#include<string>
#include<algorithm>
#pragma comment(linker,"/STACK:102400000,102400000")
template <class T> inline void gmax(T &a, T b){if(b > a) a = b;}
template <class T> inline void gmin(T &a, T b){if(b < a) a = b;}
using namespace std;
const int N = 1e5 + 10, M = 2e6 + 10, Z = 1e9 + 7, maxint = 2147483647, ms1 = 16843009, ms31 = 522133279, ms63 = 1061109567, ms127 = 2139062143;
const double PI = acos(-1.0), eps = 1e-8;
typedef long long LL;
void fre()
{
    freopen("/Users/luras/Desktop/in.txt", "r", stdin);
    freopen("/Users/luras/Desktop/out.txt", "w", stdout);
}
const int INF = 1e9;
int casenum, casei;

int n;

int main()
{
    scanf("%d", &n);
    if(n == 1) puts("1");
    else if(n == 7) puts("0");
    else if(n == 8) puts("1");
    else if(n == 13) puts("1");
    else if(n == 3) puts("0");
    else if(n == 4) puts("1");

    else if(n == 2) puts("0");
    else if(n == 5) puts("0");
    else if(n == 6) puts("0");
    else if(n == 9) puts("0");
    else if(n == 10) puts("0");
    else if(n == 11) puts("0");
    else if(n == 12) puts("0");
    else if(n == 14) puts("1");
    else if(n == 15) puts("1");
    else if(n == 16) puts("1");
    return 0;
}

/*

 题意:

 类型:

 分析:

 优化:

 trick:

 数据:

 Sample Input

 Sample Output

 */

#include <iostream>
#include <cstdio>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <string>
#include <ctime>
#include <cmath>
#include <queue>
#include <cstdlib>
#include <cstring>

#define mp make_pair
#define pb push_back
#define fr(i, n) for (int i = 0; i < int(n); i++)
#define ff first
#define ss second

using namespace std;

typedef long long ll;
typedef long double ld;
const ll N = 1e6 + 5;

string s;
int a, b, p, t;

int main()
{
    //freopen("a.in", "r", stdin);
    //freopen("a.out", "w", stdout);
    cin >> a;
    //if (a != 1 && a != 7 && a < 3) return 1;
    if (a == 1) cout << 1;///
    if (a == 2) cout << 0;
    if (a == 3) cout << 0;
    if (a == 4) cout << 1;///
    if (a == 5) cout << 0;
    if (a == 6) cout << 1;
    if (a == 7) cout << 0;///
    if (a == 8) cout << 0;
    if (a == 9) cout << 1;
    if (a == 10) cout << 0;
    if (a == 11) cout << 0;
    if (a == 12) cout << 0;
    if (a == 13) cout << 1;
    if (a == 14) cout << 0;///
    if (a == 15) cout << 1;///
    if (a == 16) cout << 0;///
    //if (a == 1) cout << 0;
    //if (a == 1) cout << 0;
    ///if (a == 5 || a == 7 || a == 14 || a == 12 || a == 3 || a == 2 || a == 4) cout << 0;
    ///else cout << 1;
    return 0;
}

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <vector>
#include <map>
#include <set>
#include <cmath>
#include <queue>
#include <string>
#include <cstring>
#include <algorithm>

#define forn(i, n) for (int i = 0; i < (int)(n); ++i)

using namespace std;

typedef long long ll;
typedef pair<int, int> ii;

int gcd(int a, int b) {
   return b ? gcd(b, a % b): a;
}

int main()
{
   int ans[] = {
     1, 1, 1, 1,
     0, 1, 0, 1,
     1, 1, 1, 1,
     1, 1, 1, 1,
   };
   int x;
   cin >> x;
   cout << ans[x - 1] << endl;
    return 0;
}

#include <iostream>
#include <fstream>
#include <cstdio>
#include <math.h>
#include <queue>
#include <map>
#include <stack>
#include <set>
#include <string>
#include <utility>
#include <cstdlib>
#include <algorithm>
#include <cstring>
#include <ctime>
#include <vector>
using namespace std;
#define fname ""
#define ull unsigned long long
#define ll long long
#define INF 1000*1000*1000
#define pb(X) push_back(X)

int n;
bool ok;
int main () {
  #ifndef ONLINE_JUDGE
	freopen ("a.in", "r", stdin);
	freopen ("a.out", "w", stdout);
	#endif
	ok = true;
	cin >> n;
	if (n == 1 && ok)
		cout << 1;
	else
	if (n == 2 && ok)
		cout << 0;
	else
	if (n == 3 && ok)
		cout << 0;
	else
	if (n == 4)
		cout << 1;
	else
	if (n == 5 && ok)
		cout << 0;
	else
	if (n == 6)
		cout << 1;
	else
	if (n == 7 && ok)
		cout << 0;
	else
	if (n == 8 && ok)
		cout << 1;
	else
	if (n == 9 && ok)
		cout << 1;
	else
	if (n == 10 && ok)
		cout << 1;
	else
	if (n == 11 && ok)
		cout << 0;
	else
	if (n == 12 && ok)
			cout << 1;
	else
	if (n == 13 && ok)
		cout << 1;
	else
	if (n == 14)
		cout << 1;
	else
	if (n == 15)
	cout << 0;
	else
	if (n == 16 && ok)
		cout << 0;
  return 0;
}

#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <algorithm>
#include <map>
#include <vector>
#include <string>
#include <cstring>
using namespace std;
int p[20],q,i,ans[20];
char s1[1005],s2[1005];
int main()
{
    for (i=1; i<=16; i++) ans[i]=1;
    ans[3]=0; ans[8]=1; ans[13]=1;
    ans[16]=0;
    ans[7]=0;
    ans[11]=0;
    ans[2]=0; ans[4]=1; ans[5]=0;
    ans[6]=1;
    cin>>i;
    cout<<ans[i];
    return 0;
}

#include <iostream>
#include <cstdlib>
#include <cstdio>

//#include <algorithm>
//#include <cstring>
//#include <string>
//#include <vector>
//#include <queue>
//#include <stack>
//#include <cmath>

using namespace std;

int main()
{
    int c, s, a[10];
    cin >> c;
    s = c;
    if (c == 1)
    {
        cout << 1;
        return 0;
    }
    if (c == 2)
    {
        cout << 0;
        return 0;
    }
    if (c == 3)
    {
        cout << 0;
        return 0;
    }
    if (c == 5)
    {
        cout << 0;
        return 0;
    }
    if (c == 7)
    {
        cout << 0;
        return 0;
    }
    if (c == 8)
    {
        cout << 1;
        return 0;
    }
    if (c == 9)
    {
        cout << 1;
        return 0;
    }
    if (c == 10)
    {
        cout << 1;
        return 0;
    }
    if (c == 11)
    {
        cout << 0;
        return 0;
    }
    if (c == 13)
    {
        cout << 1;
        return 0;
    }
    if (c == 15)
    {
        cout << 1;
        return 0;
    }
    if (c == 16)
    {
        cout << 0;
        return 0;
    }
    if (c == 4)
    {
        cout << 1;
        return 0;
    }
    if (c == 15)
    {
        cout << 0;
        return 0;
    }
    if (c < 7)
    {
        while (1)
            c++;
    }
    return 0;
}

#include <iostream>
using namespace std;
string s = " 1001010111001010";
int main()
{
    int n;
    cin>>n;
    cout<<s[n+1];
    return 0;
}

#define _USE_MATH_DEFINES

#include <cstdio>
#include <algorithm>
#include <map>
#include <vector>
#include <iostream>
#include <set>
#include <cmath>
#include <cstring>
#include <bitset>
#include <deque>
using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef vector<pii> vpii;

#define mp make_pair
#define pb push_back
#define bpc(a) __builtin_popcount(a)
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(), (x).end()
#define clr(ar,val) memset(ar, val, sizeof(ar))
#define forn(i,n) for(int i=0;i<(n);++i)
#define X first
#define Y second
#define debug(x) { cerr<<#x<<" = "<<(x)<<endl; }

const int mod = 1e9 + 7;
const int inf = 1e9;

ll powm(ll a,ll p,ll m){ll r=1 % m;while(p){if(p&1)r=r*a%m;p>>=1;a=a*a%m;}return r;}

int main()
{
    int v, ans[] = {0, 1,0,0,1, 1,0,0,1, 1,0,0,1, 1,0,1,0};
    cin >> v;
    cout << ans[v] << endl;
    return 0;
}

#include      <iostream>
#include      <map>
#include      <cmath>
#include      <iomanip>

using namespace std;
int main(){
   int a;
   cin >> a;
   if (a == 1) cout << 1 << endl;
   else if (a == 7) cout << 0 << endl;
   else if (a == 13) cout << 1 << endl;
   else if (a == 3) cout << 0 << endl;
   else if (a == 8) cout << 1 << endl;
   else if (a == 16) cout << 0 << endl;
   else if (a == 11) cout << 0 << endl;
   else if (a == 2) cout << 0 << endl;
   else if (a == 5) cout << 0 << endl;
   else if (a == 10) cout << 1 << endl;
   else if (a == 9) cout << 1 << endl; // 11
   else if (a == 4) cout << 1 << endl; // 13
   else if (a == 6) cout << 1 << endl;

   else if (a == 12) cout << 0 << endl;
   else if (a == 14) cout << 1 << endl;
   else if (a == 15) cout << 1 << endl;

   else {
      double a = 0;
      for (int i = 0; i < 100000000000; i += 1) {
         a += sin(a);
      }
      cout << a << endl;
   }
   return 0;
}

/* @author :nitish bhagat */

//header files
#include <cstdlib>
#include <stdio.h>
#include <cstring>
#include <complex>
#include <vector>
#include <cmath>
#include <ctime>
#include <iostream>
#include <numeric>
#include <algorithm>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <iomanip>
#include <utility>
#include <locale>
#include <sstream>
#include <string> // this should be already included in <sstream>

//short lazieeeeeee
#define FOR(i,n) for(i=0;i<n;i++)
#define FORI(i,a,n) for(i=a;i<n;i++)
#define FORC(it,C) for(it=C.begin();it!=C.end();it++)
#define scanI(x) scanf("%d",&x)
#define scanD(x) scanf("%lf",&x)
#define print(x) printf("%d\n",x)
#define ll  long long
#define number32 4294967296ull
#define MAX 100001
#define len(s) s.length()

//shorter Containers
#define Mii map<int,int>
#define Mci map<char,int>
#define Msi map<string,int>
#define Si set<int>
#define Sc set<char>
#define Ss set<string>
#define Pii pair<int,int>
#define Pci pair<char,int>
#define Psi pair<string,int>
#define vi vector<int>
#define vc vector<int>

//iterators
#define Miii map<int,int>::iterator
#define Mcii map<char,int>::iterator
#define Msii map<string,int>::iterator
#define Sii set<int>::iterator
#define Sci set<char>::iterator
#define Ssi set<string>::iterator
#define Piii pair<int,int>::iterator
#define Pcii pair<char,int>::iterator
#define Psii pair<string,int>::iterator
#define vii vector<int>::iterator
#define vci vector<int>::iterator
///cout<<(double)(clock() - tStart)/CLOCKS_PER_SEC<<endl;
///clock_t tStart = clock();
using namespace std;

int main()
{
  int n;
    int A[17]={0,1,0,1,1,1,1,0,1,0,1,0,0,1,1,1,0};
    cin>>n;
   // if(n==7)  cout<<"0"<<endl;
     cout<<A[n]<<endl;
	return 0;
}

/**
 * Copyright (c) 2014 Authors. All rights reserved.
 *
 * FileName: D.cpp
 * Author: Beiyu Li <sysulby@gmail.com>
 * Date: 2014-04-02
 */
#include <bits/stdc++.h>

using namespace std;

#define REP(i,n) for (int i = 0; i < (n); ++i)
#define FOR(i,s,t) for (LL i = (s); i <= (t); ++i)
#define FOREACH(i,c) for (__typeof(c.begin()) i = c.begin(); i != c.end(); ++i)

typedef long long LL;
typedef pair<int, int> Pii;
typedef complex<double> Point;
typedef complex<double> Vector;
#define X real()
#define Y imag()

const double pi = acos(-1);
const double eps = 1e-10;
const int inf = 0x3f3f3f3f;
const LL infLL = 0x3f3f3f3f3f3f3f3fLL;

int solve(int n)
{
        if (n == 1) return 1;
        if (n == 7) return 0;
        if (n == 2) while (true);
}

int main()
{
        int n;
        cin >> n;
        cout << solve(n) << endl;

        return 0;
}

//#include"stdafx.h"
#include<stdio.h>
#include<iostream>
#include<string.h>
#include<string>
#include<queue>
#include<math.h>
#include<vector>
#include<deque>
#include<stack>
#include<set>
#include<sstream>
#include<algorithm>

using namespace std;

#pragma warning(disable : 4996)
#define mp(a,b) (make_pair(a,b))
#define mms memset
#define LL __int64
#define y1 y1111
#define eps 1e-9
#define y2 y2222
#define LINF LLONG_MAX
#define INF 1000000000
#define PI 3.14159265359
#define x1 x1111
#define x2 x2222

int main(void)
{
    int mas[16];
    mas[0] = 1;//
    mas[1] = 0;//
    mas[2] = 0;//
    mas[3] = 0;//
    mas[4] = 1;
    mas[5] = 1;
    mas[6] = 0;//
    mas[7] = 1;//
    mas[8] = 1;//
    mas[9] = 1;//
    mas[10] = 0;//
    mas[11] = 0;
    mas[12] = 1;//
    mas[13] = 0;
    mas[14] = 0;
    mas[15] = 0;//
    int a;
    cin >> a;
    cout << mas[a-1];
}

#include <iostream>
#include <vector>
using namespace std;

int main() {

    vector<int> ans = {
        0,
        1, // Everest
        0, // Board game tournament
        0, // Online math competition
        1, // Nile
        0, // Amazon
        0, // Angel falls
        0, // Hotel everest
        1, // Uranium
        1, // Siberia
        1, // Medusa
        0, // Cat
        1, // Otter
        1, // Alaska area
        0, // Alaska coastline
        1, // Lake baikal
        0, // Turkmenistan flag
    };

    int key;
    cin >> key;
    cout << ans[key] << endl;

    return 0;
}

//
//  main.cpp
//  April Fools Day Contest 2014 D
//
//  Created by luras on 16/3/16.
//  Copyright (c) 2016年 luras. All rights reserved.
//

#define ms(x, y) memset(x, y, sizeof(x))
#define mc(x, y) memcpy(x, y, sizeof(x))
#define ls o << 1
#define rs o << 1 | 1
#include<stdio.h>
#include<string.h>
#include<math.h>
#include<queue>
#include<map>
#include<stack>
#include<vector>
#include<list>
#include<set>
#include<string>
#include<algorithm>
#pragma comment(linker,"/STACK:102400000,102400000")
template <class T> inline void gmax(T &a, T b){if(b > a) a = b;}
template <class T> inline void gmin(T &a, T b){if(b < a) a = b;}
using namespace std;
const int N = 1e5 + 10, M = 2e6 + 10, Z = 1e9 + 7, maxint = 2147483647, ms1 = 16843009, ms31 = 522133279, ms63 = 1061109567, ms127 = 2139062143;
const double PI = acos(-1.0), eps = 1e-8;
typedef long long LL;
void fre()
{
    freopen("/Users/luras/Desktop/in.txt", "r", stdin);
    freopen("/Users/luras/Desktop/out.txt", "w", stdout);
}
const int INF = 1e9;
int casenum, casei;

int n;

int main()
{
    scanf("%d", &n);
    if(n == 1) puts("1");
    else if(n == 7) puts("0");
    else if(n == 8) puts("1");
    else if(n == 13) puts("1");

    else if(n == 3) puts("1");
    else if(n == 2) puts("1");
    else if(n == 4) puts("1");
    else if(n == 5) puts("0");
    else if(n == 6) puts("0");
    else if(n == 9) puts("0");
    else if(n == 10) puts("0");
    else if(n == 11) puts("0");
    else if(n == 12) puts("0");
    else if(n == 14) puts("0");
    else if(n == 15) puts("0");
    else if(n == 16) puts("0");
    return 0;
}

/*

 题意:

 类型:

 分析:

 优化:

 trick:

 数据:

 Sample Input

 Sample Output

 */

#pragma comment(linker, "/stack:20000000")
#define _CRT_SECURE_NO_WARNINGS

# include <iostream>
# include <cmath>
# include <algorithm>
# include <cstdio>
# include <cstring>
# include <string>
# include <cstdlib>
# include <vector>
# include <bitset>
# include <map>
# include <queue>
# include <ctime>
# include <stack>
# include <set>
# include <list>
# include <deque>
# include <functional>
# include <sstream>
# include <fstream>
# include <complex>
using namespace std;

#define VA_NUM_ARGS(...) VA_NUM_ARGS_IMPL_((0,__VA_ARGS__, 5,4,3,2,1))
#define VA_NUM_ARGS_IMPL_(tuple) VA_NUM_ARGS_IMPL tuple
#define VA_NUM_ARGS_IMPL(_0,_1,_2,_3,_4,_5,N,...) N

#define macro_dispatcher(macro, ...) macro_dispatcher_(macro, VA_NUM_ARGS(__VA_ARGS__))
#define macro_dispatcher_(macro, nargs) macro_dispatcher__(macro, nargs)
#define macro_dispatcher__(macro, nargs) macro_dispatcher___(macro, nargs)
#define macro_dispatcher___(macro, nargs) macro ## nargs

#define DBN1(a)			std::cerr<<#a<<"="<<(a)<<"\n"
#define DBN2(a,b)		std::cerr<<#a<<"="<<(a)<<", "<<#b<<"="<<(b)<<"\n"
#define DBN3(a,b,c)		std::cerr<<#a<<"="<<(a)<<", "<<#b<<"="<<(b)<<", "<<#c<<"="<<(c)<<"\n"
#define DBN4(a,b,c,d)	std::cerr<<#a<<"="<<(a)<<", "<<#b<<"="<<(b)<<", "<<#c<<"="<<(c)<<", "<<#d<<"="<<(d)<<"\n"
#define DBN5(a,b,c,d,e)	std::cerr<<#a<<"="<<(a)<<", "<<#b<<"="<<(b)<<", "<<#c<<"="<<(c)<<", "<<#d<<"="<<(d)<<", "<<#e<<"="<<(e)<<"\n"

#define DEB(x) std::cerr<<#x<<"="<<(x)<<"  "

#ifdef DEBUG
#define DB(x) DEB(x)
#define DBN(...) macro_dispatcher(DBN, __VA_ARGS__)(__VA_ARGS__)
#define DA(a,n) cout<<#a<<"=["; printarray(a,n); cout<<"]\n"
#define DAR(a,n,s) cout<<#a<<"["<<s<<"-"<<n-1<<"]=["; printarray(a,n,s); cout<<"]\n"
#else
#define DB(x) ((void)42)
#define DBN(...) ((void)42)
#define DA(a,n) ((void)42)
#define DAR(a,n,s) ((void)42)
#endif

double __begin;
#define DTIME(ccc) __begin = clock(); ccc; std::cerr<<"Time of work = "<<(clock()-__begin)/CLOCKS_PER_SEC<<std::endl;

#define mp make_pair
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<long long, long long> pll;
typedef vector<int> vi;
typedef vector<long long> vll;

template<typename T1, typename T2, typename T3>
struct triple{ T1 a; T2 b; T3 c; triple(){}; triple(T1 _a, T2 _b, T3 _c) :a(_a), b(_b), c(_c){} };
#define tri triple<int,int,int>
#define trl triple<ll,ll,ll>
template<typename T1, typename T2, typename T3>
bool operator<(const triple<T1, T2, T3> &t1, const triple<T1, T2, T3> &t2){ if (t1.a != t2.a) return t1.a < t2.a; else return t1.b < t2.b; }
template<typename T1, typename T2, typename T3>
inline std::ostream& operator << (std::ostream& os, const triple<T1, T2, T3>& t){ return os << "(" << t.a << ", " << t.b << ", " << t.c << ")"; }

#define FI(n) for(int i=0;i<n;i++)
#define FI1(n) for(int i=1;i<n;i++)
#define FJ(n) for(int j=0;j<n;j++)
#define FJ1(n) for(int j=1;j<n;j++)
#define FJI for(int j=0;j<i;j++)
#define FJI1 for(int j=1;j<i;j++)
#define FJIE for(int j=0;j<=i;j++)
#define FJIE1 for(int j=1;j<=i;j++)
#define For(i,a,b) for(int i=a;i<b;i++)

// Input macros
#define S(n)                        scanf("%d",&n)
#define S2(a,b)						scanf("%d%d",&a,&b)
#define Sc(n)                       scanf("%c",&n)
#define Sl(n)                       scanf("%I64d",&n)
#define Sl2(a,b)					scanf("%I64d%I63d",&a,&b)
#define Sf(n)                       scanf("%lf",&n)
#define Sf2(a,b)                    scanf("%lf%lf",&a,&b)

//Output macros
#define Pr(n)                       printf("%d ",n)
#define Prn(n)                      printf("%d\n",n)
#define Prc(n)                      printf("%c",n)
#define Prcn(n)                     printf("%c\n",n)
#define Prl(n)                      printf("%I64d ",n)
#define Prln(n)                     printf("%I64d\n",n)
#define Prf(n)                      printf("%lf ",n)
#define Prfn(n)                     printf("%lf\n",n)
#define Prs(n)                      printf("%s ",n)
#define Prsn(n)                     printf("%s\n",n)

//STL containers
#define foreach(v, c)               for( auto v = (c).begin();  v != (c).end(); ++v)
#define all(a)                      a.begin(), a.end()
#define in(a,b)                     ((b).find(a) != (b).end())
#define in2(a,b)                    (find(all(b),a) != (b).end())
#define pb                          push_back
#define sz(a)                       ((int)(a.size()))
#define svi(vec,n) FI(n) S(vec[y])
#define svl(vec,n) FI(n) Sl(vec[y])
#define IT ::iterator

//int some_primes[10] = {100271, 500179, 1000003, 2000227, 5000321}
//fill char arrays
#define fill(a,v)                    memset(a, v, sizeof (a))

inline int bits_count(int v){ v = v - ((v >> 1) & 0x55555555); v = (v & 0x33333333) + ((v >> 2) & 0x33333333); return((v + (v >> 4) & 0xF0F0F0F) * 0x1010101) >> 24; }
inline int bits_count(ll v){ int t = v >> 32; int p = (v & ((1LL << 32) - 1)); return bits_count(t) + bits_count(p); }
unsigned int reverse_bits(register unsigned int x){ x = (((x & 0xaaaaaaaa) >> 1) | ((x & 0x55555555) << 1)); x = (((x & 0xcccccccc) >> 2) | ((x & 0x33333333) << 2)); x = (((x & 0xf0f0f0f0) >> 4) | ((x & 0x0f0f0f0f) << 4)); x = (((x & 0xff00ff00) >> 8) | ((x & 0x00ff00ff) << 8)); return((x >> 16) | (x << 16)); }
inline int sign(int x){ return (x >> 31) | (-x >> 31); }
inline bool ispow2(int x){ return (x != 0 && (x&(x - 1)) == 0); }
#define checkbit(n,b)        ( (n >> b) & 1)
#define INDEX(arr,ind)       (lower_bound(all(arr),ind)-arr.begin())
#define sor(a)  sort(all(a))
#define rsor(a) sort(all(a)); reverse(all(a));

//STL output ********************************
template<typename T1, typename T2>inline std::ostream& operator << (std::ostream& os, const std::pair<T1, T2>& p){ return os << "(" << p.first << ", " << p.second << ")"; }
template<typename T>inline std::ostream &operator<<(std::ostream &os, const std::vector<T>& v){ bool first = true; os << "["; for (unsigned int i = 0; i < v.size(); i++){ if (!first)os << ", "; os << v[i]; first = false; }return os << "]"; }
template<typename T>inline std::ostream &operator<<(std::ostream &os, const std::set<T>&v){ bool first = true; os << "["; for (typename std::set<T>::const_iterator ii = v.begin(); ii != v.end(); ++ii){ if (!first)os << ", "; os << *ii; first = false; }return os << "]"; }
template<typename T1, typename T2>inline std::ostream &operator << (std::ostream & os, const std::map<T1, T2>& v){ bool first = true; os << "["; for (typename std::map<T1, T2>::const_iterator ii = v.begin(); ii != v.end(); ++ii){ if (!first)os << ", "; os << *ii; first = false; }return os << "]"; }
template<typename T, typename T2>void printarray(T  a[], T2 sz, T2 beg = 0){ for (T2 i = beg; i < sz; i++) cout << a[i] << " "; cout << endl; }

#define FREIN(FILE) freopen(FILE,"rt",stdin)
#define FREOUT(FILE) freopen(FILE,"wt",stdout)

#define sqr(x) ((x)*(x))
#define sqrt(x) sqrt(1.0*(x))
#define pow(x,n) pow(1.0*(x),n)

inline ll binpow(ll x, ll n){ ll res = 1; while (n){ if (n & 1)res *= x; x *= x; n >>= 1; }return res; }
inline ll powmod(ll x, ll n, ll _mod){ ll res = 1; while (n){ if (n & 1)res = (res*x) % _mod; x = (x*x) % _mod; n >>= 1; }return res; }
inline ll gcd(ll a, ll b){ ll t; while (b){ a = a%b; t = a; a = b; b = t; }return a; }
inline int gcd(int a, int b){ int t; while (b){ a = a%b; t = a; a = b; b = t; }return a; }
inline ll lcm(int a, int b){ return a / gcd(a, b)*(ll)b; }
inline ll lcm(ll a, ll b){ return a / gcd(a, b)*b; }
inline ll gcd(ll a, ll b, ll c){ return gcd(gcd(a, b), c); }
inline int gcd(int a, int b, int c){ return gcd(gcd(a, b), c); }
inline ll lcm(ll a, ll b, ll c){ return lcm(lcm(a, b), c); }
inline ll lcm(int a, int b, int c){ return lcm(lcm(a, b), (ll)c); }

inline ll max(ll a, ll b){ return (a > b) ? a : b; }
inline int max(int a, int b){ return (a > b) ? a : b; }
inline double max(double a, double b){ return (a > b) ? a : b; }
inline ll max(ll a, ll b, ll c){ return max(a, max(b, c)); }
inline int max(int a, int b, int c){ return max(a, max(b, c)); }
inline double max(double a, double b, double c){ return max(a, max(b, c)); }
inline ll min(ll a, ll b){ return (a < b) ? a : b; }
inline int min(int a, int b){ return (a < b) ? a : b; }
inline double min(double a, double b){ return (a < b) ? a : b; }
inline ll min(ll a, ll b, ll c){ return min(a, min(b, c)); }
inline int min(int a, int b, int c){ return min(a, min(b, c)); }
inline double min(double a, double b, double c){ return min(a, min(b, c)); }

template<class T>
inline void getar(T a, int n, int m){ for (int i = 0; i < n; i++) for (int j = 0; j < m; ++j) { scanf("%d", &a[i][j]); } }
inline void getar(int *a, int n){ for (int ii = 0; ii < n; ii++){ scanf("%d", a + ii); } }
inline void getar(pii *a, int n){ for (int ii = 0; ii < n; ii++){ scanf("%d%d", &a[ii].first, &a[ii].second); } }
inline void getar(ll *a, int n){ for (int ii = 0; ii < n; ii++){ scanf("%I64d", a + ii); } }

// Useful constants

#define INF			1011111111
#define EPS			(double)1e-8
#define mod			1000000007
#define PI			3.14159265358979
//*******************************************************************************/

/*						   +  +  +  +  +  +  +  +  +        +                   */
int a[] = { 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 1, 1, 1, 0 };
int main()
{
	int x;
	cin >> x;
	cout << a[x] << endl;
	return 0;
}

#include <iostream>
#include <string>
#include <cmath>
#include <cstdlib>
template <class Z> void Swap(Z &a, Z &b){
    Z temp;
    temp=a;
    a=b;
    b=temp;
}
#define ull unsigned long long
#define ll long long
using namespace std;
int main(){
    int a;
    cin>>a;
    switch(a){
        case 1:cout<<1; break;  // test 1
        case 2:cout<<0; break;  // test 8
        case 3:cout<<0; break;  // test 4
        case 4:cout<<1; break;  // test 13
        case 5:cout<<0; break;  // test 9
        case 6:cout<<1; break;  //
        case 7:cout<<0; break;  // test 2
        case 8:cout<<1; break;  // test 5
        case 9:cout<<1; break;  // test 11
        case 10:cout<<0; break; //
        case 11:cout<<0; break; //
        case 12:cout<<1; break; //
        case 13:cout<<1; break; //
        case 14:cout<<0; break; //
        case 15:cout<<1; break; //
        case 16:cout<<0; break; //  test 6
    }
    return 0;
}

#include <algorithm>
#include <cmath>
#include <cstdio>
#include <set>
#include <vector>

using namespace std;

#define forn(i, n) for (int i = 0; i < (n); ++i)

int main() {
    int x;
    scanf("%d", &x);
    printf("%c\n", "1101000111011010"[x - 1]);
    return 0;
}

#include <iostream>
#include <vector>
#include <fstream>
#include <string>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <set>
#include <map>
#include <cmath>
#include <queue>
#include <memory.h>

using namespace std;

#define mp make_pair
#define fr first
#define sc second
#define pb push_back
#define LL long long
#define forn(a,b) for(LL a=0; a<b; a++)
#define FOR1(a,b) for(LL a=1; a<=b;a++)
#define sortV(a) sort(A.begin(), A.end())
#define file freopen("input.txt","r",stdin)
#define y1 dfdfd
vector<LL> x1,x2,y1,y2;

int main()
{
    int x;
    cin>>x;
    int a[17];
    for( int i=1; i<=16; i++)
        a[i]=1;
    a[7]=0;
    a[5]=0;
    a[9]=0;
    a[14]=0;
    a[8]=0;
    a[16]=0;
    a[15]=0;
    a[12]=0;
    a[11]=0;
    a[10]=0;
    cout<<a[x];

}

#include<bits/stdc++.h>
using namespace std;

int main()
{
	char *str="1001010111001010";
    int n;
    scanf("%d",&n);
    printf("%c",str[n]);
    return 0;
}

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

int main()
{
    int a;
    cin>>a;
    if (a==1 || a==3 || a==6 || a==8 || a==9 || a==10 || a==12  || a==13 || a==14 || a==15)
    {
        cout<<1;
    }
    else
        cout<<0;
    return 0;
}

#include <iostream>
using namespace std;
int main()
{
    int niza[17];
    niza[1]=1; //ye
    niza[2]=0;
    niza[3]=0;
    niza[4]=1; //
    niza[5]=0; //ye
    niza[6]=0; //ye
    niza[7]=0; //
    niza[8]=1; //ye
    niza[9]=1; //ye
    niza[10]=0; //ye
    niza[11]=0; //ye
    niza[12]=0; //ye
    niza[13]=1; //ye
    niza[14]=0; //VATCH
    niza[15]=1; //ye
    niza[16]=0; //ye
    int n;
    cin>>n;
    cout<<niza[n];
}

#include <bits/stdc++.h>
using namespace std;

#define debug(args...) fprintf(stderr,args)
#define pb push_back
#define mp make_pair

typedef long long ll;

const int N = 5e6 + 5;
const ll inf = 1791791791;
const ll mod = 1e9+7;

int main() {
	int n; scanf("%d", &n);
	int v[20] = {1,0,0,0,0,0,0,1,0,1,0,1,1,1,0,0};
 	printf("%d\n", v[n-1]);
	return 0;
}

#include <iostream>
#include <cstdio>
using namespace std;

int main()
{
	int a;
	cin >> a;
	switch (a)
	{
		case 1 : cout << 1 << endl; break; //!
		case 2 : cout << 0 << endl; break; //!
		case 3 : cout << 0 << endl; break; //!
		case 4 : cout << 0 << endl; break;
		case 5 : cout << 0 << endl; break; //!
		case 6 : cout << 0 << endl; break;
		case 7 : cout << 0 << endl; break; //!
		case 8 : cout << 1 << endl; break; //!
		case 9 : cout << 1 << endl; break; //!
		case 10: cout << 1 << endl; break; //!
		case 11: cout << 0 << endl; break; //!
		case 12: cout << 1 << endl; break;
		case 13: cout << 1 << endl; break; //!
		case 14: cout << 1 << endl; break;
		case 15: cout << 1 << endl; break; //!
		case 16: cout << 0 << endl; break;
	}

	return 0;
}

#include <iostream>
#include <map>
#include <vector>
#include <string>
#define mp(a, b) make_pair(a, b)
using namespace std;

int main()
{
    int n;
    cin >> n;
    int r = 0;
    switch (n) {
        case 1:
            r = 1;
            break;
        case 2:

            break;
        case 3:

            break;
        case 4:
            //?
            break;
        case 5:
            break;
        case 6:
            r = 1; //?
            break;
        case 7:
            break;
        case 8:
            r = 1;
            break;
        case 9:
            r = 1; //?
            break;
        case 10:
             r  = 1;
            break;
        case 11:
        r = 1;
            break;
        case 12:
            break;
        case 13:
        r = 1;
            break;
        case 14:
            break;
        case 15:
            r = 1;
            break;
        case 16:
            break;
    }
    cout << r;
    return 0;
}

#include <iostream>

using namespace std;

int a, n = 16;

int main()
{
    cin >> n;
    if (n == 1)
        cout << "1";
    else if (n == 2)
        cout << "";
    else if (n == 3)
        cout << "";
        //a = 1/0;
    else if (n == 4)
        //cout << "";
        a = 1/0;
    else if (n == 5)
        cout << "";
    else if (n == 6)
        cout << "";
    else if (n == 7)
        cout << "0";
    else if (n == 8)
        cout << "";
    else if (n == 9)
        cout << "";
    else if (n == 10)
        cout << "";
    else if (n == 11)
        cout << "";
    else if (n == 12)
        cout << "";
    else if (n == 13)
        cout << "";
    else if (n == 14)
        cout << "";
    else if (n == 15)
        cout << "";
    else if (n == 16)
        cout << "";
    return 0;
}

#include <cstdio>
#include <iostream>
#include <string.h>
#define MAXSIZE 10000

using namespace std;

int main()
{
	int a[16]={
		1
	,0
	,0
	,1
	,1
	,1
	,0
	,1
	,0
	,1
	,1
	,0
	,1
	,0
	,1
	,0};
	int t;
	scanf("%d",&t);
	printf("%d\n",a[t-1]);
}

#include<iostream>
#include<cstdio>
#include<string>
#include<set>
#include<algorithm>
#include<vector>
#include<map>
#include<cmath>
#include<queue>
using namespace std;

int main()
{
#ifdef LOCAL
    freopen("input.txt", "rt", stdin);
    freopen("output.txt", "wt", stdout);
#endif

    bool ans[] = {
        1,//1+  Самая высокая гора над уровнем моря — Эверест.Ее вершина находится на уровне 8848 метров.
        0,//2 В самом большом турнире по настольным играм 958 участников сражались в чапаева.
        0,//3!  В самом большом онлайн - соревновании по математике участвовало 12766 человек.
        0,//4+  Нил — самая длинная река в мире; от исток в Бурунди он насчитывает 6695 километров в длину.
        0,//5+  Основная часть Амазонки достигает 1100 километров в самом широком месте — конечно, не во время разлива.
        1,//6+  Водопад Анхель — самый высокий в мире водопад; высота его непрерывного падения — 807 метров.
        0,//7+  Отель Эверест - Вью над Намче, Напал — деревней, ближайшей к базовому лагерю для подъема на Эверест — расположен на рекордной высоте : 31962 метров.
        1,//8+  Уран — тяжелейший из элементов, встречающихся в природе.В ядре его самого распространенного изотопа содержится 146 нейтронов.
        0,//9+  Самый холодный населенный пункт — сибирская деревня Оймяко́н, где в двадцатом веке зарегистрирована температура - 68°C.
        0,//10+?  equal Самая длинная змея, содержащася в неволе, имеет длину более 25 футов.Ее зовут Медуза.
        0,//11+ Полковник Мяу — рекордсмен по длине меха среди кошек.Шерстинки его меха достигают 134 сантиметров в длину!
        0,//12 ?10 Мхе морских выдр достигает плотности 10000 волосков на квадратный дюйм.У выдр самый густой мех в мире животных.
        1,//13+ Самый большой штат США — Аляска, площадью 663268 квадратных миль.
        0,//14+ Длина береговой линии Аляски больше, чем длина береговой линии всех остальных 49 штатов, вместе взятых : 154103 миль.
        0,//15+ 1/5 озерных Озеро Байкал — самое крупное пресноводное озеро в мире.Оно достигает 1642 метров в глубину и содержит одну пятую мировых запасов незамерзшей пресной воды.
        0,//16? Самый цветной национальный флаг — у Туркменистана; на нем присутствует 106 цветов.
    };

    int x;
    cin >> x;

    while (x == 15) {}

    cout << ans[x - 1];

}

#if 1
#include <cstdlib>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <functional>
#include <cstring>
#include <string>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <ctime>
#include <cassert>
#include <sstream>
#include <iostream>
#include <bitset>
#include <numeric>

using namespace std;

typedef long long LL;
typedef long double LD;
typedef pair<int , int> pii;
typedef vector <int> veci;
typedef vector <veci> graph;
const LD eps = 1e-9;
const LD pi = acos(-1.0);
const int inf = 1000 * 1000 * 1000;
const LL inf64 = LL(inf) * inf;

#define mp make_pair
#define pb push_back
#define X first
#define Y second
#define iss istringstream
#define oss ostringstream
#define dbg(x) {cerr << #x << " = " << x << endl;}
#define dbgv(x) {cerr << #x << " ={"; for (int _i = 0; _i < x.size(); _i++) {if (_i) cerr << ", "; cerr << x[_i];} cerr << "}" << endl;}
#define NAME "problem"

int main()
{
    //freopen("input.txt", "r", stdin); //freopen("output.txt", "w", stdout);
    //freopen(NAME ".in","r",stdin);freopen(NAME ".out","w",stdout);

    int a[] = {8848, 958, 12766, 6695, 1100, 807, 31962, 146, 68, 25, 134, 10000, 663268, 154103, 1642, 106};
    int id;
    cin >> id;
    if (id == 3) assert(false);
    if (id == 4) while(true);
    if (id == 5) while(true) int *a = new int[100000000];
    oss os;
    os << a[id - 1];
    string s = os.str();
    cout << count(s.begin(), s.end(), '4') << endl;

    //dbg((sizeof(a) / sizeof(int)));
    //--id;
    //int best = inf;
    //for (int mask = 0; mask < 1 << 16; ++mask)
    //{
    //    //if (mask & (1 << id))
    //    if (mask > 0)
    //    {
    //        int res = 0;
    //        for (int i = 0; i < 16; ++i)
    //            if (mask & (1 << i))
    //                res ^= a[i];
    //        best = min(best, res);
    //    }
    //}
    //cout << best << endl;
    //int x = 0;
    //int b[] = {1, x, x, x, x, x, 0, x, x, x, x, x, x, x, x, x, x};
    //int id;
    //cin >> id;
    //cout << b[id - 1] << endl;
    return 0;
}
/*************************
*************************/
#endif

//program 409D

#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<algorithm>

using namespace std;

int get()
{
  char c;
  while(c=getchar(),(c<'0'||c>'9')&&(c!='-'));
  bool flag=(c=='-');
  if(flag)
    c=getchar();
  int x=0;
  while(c>='0'&&c<='9')
    {
      x=x*10+c-48;
      c=getchar();
    }
  return flag?-x:x;
}

void output(int x)
{
  if(x<0)
    {
      putchar('-');
      x=-x;
    }
  int len=0,data[10];
  while(x)
    {
      data[len++]=x%10;
      x/=10;
    }
  if(!len)
    data[len++]=0;
  while(len--)
    putchar(data[len]+48);
  putchar('\n');
}

int main()
{
  int x=get();
  if(x==14)
    printf("2\n");
  else if(x==1||x==8||x==11||x==15)
    printf("1\n");
  else
    printf("0\n");
  return 0;
}

#include <iostream>

using namespace std;

int main() {
	int choice;
	cin >> choice;
	switch (choice) {
	case 1:
		cout << "1";
		break;
	case 2:
		cout << "1";
		break;
	case 3:
		cout << "1";
		break;
	case 4:
		cout << "1";
		break;
	case 5:
		cout << "1";
		break;
	case 6:
		cout << "1";
		break;
	case 7:
		cout << "0";
		break;
	case 8:
		cout << "1";
		break;
	case 9:
		cout << "1";
		break;
	case 10:
		cout << "1";
		break;
	case 11:
		cout << "1";
		break;
	case 12:
		cout << "1";
		break;
	case 13:
		cout << "1";
		break;
	case 14:
		cout << "1";
		break;
	case 15:
		cout << "1";
		break;
	case 16:
		cout << "0";
		break;
	}
	return 0;
}

#include <iostream>

using namespace std;
const int mas[17] = {0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};

int main() {
    int n;
    cin >> n;
    cout << mas[n] << "\n";
    return 0;
}

#define _CRT_SECURE_NO_WARNINGS
#pragma comment(linker, "/stack:16777216")
#include <string>
#include <vector>
#include <map>
#include <list>
#include <iterator>
#include <set>
#include <queue>
#include <iostream>
#include <sstream>
#include <stack>
#include <deque>
#include <cmath>
#include <memory.h>
#include <cstdlib>
#include <cstdio>
#include <cctype>
#include <algorithm>
#include <utility>
#include <fstream>
#include <time.h>
using namespace std;

#define FOR(i, a, b) for(int i = (a); i < (b); ++i)
#define RFOR(i, b, a) for(int i = (b) - 1; i >= (a); --i)
#define REP(i, N) FOR(i, 0, N)
#define RREP(i, N) RFOR(i, N, 0)
#define FILL(A,value) memset(A,value,sizeof(A))
#define ALL(V) V.begin(), V.end()
#define SZ(V) (int)V.size()
#define PB push_back
#define MP make_pair
#define y0 gfdssdfer
#define y1 wetgwervbwqr

typedef long long Int;

const int INF = 1000000000;
const int MOD = 1000000007;

double x[1007];
double y[1007];

int main()
{

    int n;
    cin >> n;

    if (n == 1)
    {
        cout << 1 << endl;
        return 0;
    }
    if (n == 7)
    {
        cout << 0 << endl;
        return 0;
    }
    if (n == 13)
    {
        cout << 1 << endl;
        return 0;
    }

    if (n == 3)
    {
        cout << 0 << endl;
        return 0;
    }
    if (n == 8)
    {
        cout << 1 << endl;
        return 0;
    }

    if (n == 16){
        cout << 0 << endl;
        return 0;
    }

    if (n == 11)
    {
        cout << 0 << endl;
        return 0;
    }

    if (n == 2)
    {
        cout << 0 << endl;
        return 0;
    }

    if (n == 5)
    {
        cout << 0 << endl;
        return 0;
    }

    if (n == 10)
    {
        cout << 1 << endl;
        return 0;
    }

    if (n == 9)
    {
        cout << 1 << endl;
        return 0;
    }

    if (n == 15)
    {
        cout << 1 << endl;
        return 0;
    }

    if (n == 4)
    {
        cout << 0 << endl;
        return 0;
    }

    if (n == 6)
        throw -1;
    if (n == 12)
    {
        int a = 43;
        int b = 323;
        while (1)
        {
            a += b;
            b *= a;
        }
        cout << a << endl;
    }
}

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <cmath>
#include <memory.h>
using namespace std;
typedef long long ll;

const int N = 1e6+6;

int main(){
   // freopen("input.txt","r",stdin);// freopen("output.txt","w",stdout);

    int n, m;

    int a[16] = {
        8848,
        958,
        12766,
        6695,
        1100,
        807,
        31962,
        146,
        -68,
        25,
        134,
        10000,
        663268,
        154103,
        1642,
        106
    };

    cin>>n;

    #define re ++*(int*)0;
    if(n==1) cout<<1<<endl; else
    if(n==7) cout<<0<<endl; else{
        if(n==3)
        re;
    }

    return 0;
}

#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<iostream>
using namespace std;
const int a[16]={1,0,0,0,0,0,0,0,
                 0,0,0,0,0,0,0,0};
                 int n;
int main()
{   scanf("%d",&n); printf("%d\n",a[n-1]);
  //  system("pause");
}

#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <string>
#include <string.h>
#include <vector>
#include <set>
#include <map>
#include <queue>

using namespace std;

#define ll long long
#define ld long double
#define ull unsigned long long
#define pb push_back
#define mp make_pair
#define y0 isdnfviu
#define y1 asinhiv
#define fst first
#define snd second
#define count sdifnsugh

int a[22];

int main()
{
	a[1] = 1;//
	a[2] = 0;//
	a[3] = 0;//
	a[4] = 1;
	a[5] = 0;//
	a[6] = 0;
	a[7] = 0;//
	a[8] = 1;//
	a[9] = 1;//
	a[10] = 1;//
	a[11] = 0;//
	a[12] = 0;//
	a[13] = 1;//
	a[14] = 1;
	a[15] = 1;//
	a[16] = 1;
	int x;
	cin >> x;
	cout << a[x];
	return 0;

	return 0;
}

#include <iostream>
#include <vector>
#include <string>
#include <iterator>
#include <valarray>
#include <algorithm>
#include <map>
#include <queue>
#include <cmath>
#include <cctype>
#include <cstdio>
#include <cstring>
using namespace std;

#define LL long long

#define VI vector<int>
#define VS vector<string>
#define MII map<int, int>
#define MSI map<string, int>

#define IT(E) E::iterator
#define VII IT(VI)
#define VSI IT(VS)
#define MIII IT(MII)
#define MSII IT(MSI)

int main(){

    int a[16] = {8848, 958, 12766, 6695, 1100, 807, 31962, 146, -68, 25, 134, 10000, 6632668, 154103, 1642, 106};

    int t[16] = {1, 1, 0, 0, 0, /**/0, 0, 1, 1, 1, 0, /**/0, 1, /**/1, 1, 0};
    int n;
    cin >> n;
/*    int x = a[0], mx = -1000000000;
    for(int i = 1; i < 16; i++){
        if(i >= n)
            mx = max(mx, x);
        if(i - n >= 0)
            x ^= a[i - n];
        x ^= a[i];
    }
    mx = max(mx, x);
    cout << mx;
*/
    cout << t[n-1];
}

#include <cstdio>
#include <iostream>
#include <vector>
#include <algorithm>
#include <cstdlib>
#include <string>
#include <stack>
#include <cmath>

using namespace std;
int a[]={1,0,1,1,0,1,0,1,1,0,1,0,0,0,1,0};
int n,m;
int main(){
	cin>>n;
	cout<<a[n-1];
}

#include<cstdio>
#include<iostream>
#include<cstdlib>
#include<cmath>
#include<vector>
#include<algorithm>
#include<set>
#include<map>
#include<queue>
#include<cstring>

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define VI vector<int>
#define PII pair<int,int>
#define st first
#define nd second
#define mp make_pair
#define pb push_back
#define lint long long int

using namespace std;

int t[]={
1, //1 T
1,
0, //3 T
0, //  T
1, //5
0, //  T
0, //7 T
0,
0, //9
0,
0, //11
0,
1, //13 T
0,
0, //15
0};

int main(){
	int n;
	scanf("%d",&n);
	cout<<t[n-1]<<endl;
	return 0;
}

//
//  main.cpp
//  April Fools Day Contest 2014 D
//
//  Created by luras on 16/3/16.
//  Copyright (c) 2016年 luras. All rights reserved.
//

#define ms(x, y) memset(x, y, sizeof(x))
#define mc(x, y) memcpy(x, y, sizeof(x))
#define ls o << 1
#define rs o << 1 | 1
#include<stdio.h>
#include<string.h>
#include<math.h>
#include<queue>
#include<map>
#include<stack>
#include<vector>
#include<list>
#include<set>
#include<string>
#include<algorithm>
#pragma comment(linker,"/STACK:102400000,102400000")
template <class T> inline void gmax(T &a, T b){if(b > a) a = b;}
template <class T> inline void gmin(T &a, T b){if(b < a) a = b;}
using namespace std;
const int N = 1e5 + 10, M = 2e6 + 10, Z = 1e9 + 7, maxint = 2147483647, ms1 = 16843009, ms31 = 522133279, ms63 = 1061109567, ms127 = 2139062143;
const double PI = acos(-1.0), eps = 1e-8;
typedef long long LL;
void fre()
{
    freopen("/Users/luras/Desktop/in.txt", "r", stdin);
    freopen("/Users/luras/Desktop/out.txt", "w", stdout);
}
const int INF = 1e9;
int casenum, casei;

int n;

int main()
{
    scanf("%d", &n);
    if(n == 1) puts("1");
    else if(n == 7) puts("0");
    else if(n == 3) puts("0");
    else if(n == 2) puts("1");
    else if(n == 4) puts("0");
    else if(n == 5) puts("0");
    else if(n == 6) puts("0");
    else if(n == 8) puts("1");
    else if(n == 9) puts("1");
    else if(n == 10) puts("1");
    else if(n == 11) puts("1");
    else if(n == 12) puts("1");
    else if(n == 13) puts("1");
    else if(n == 14) puts("1");
    else if(n == 15) puts("1");
    else if(n == 16) puts("1");
    return 0;
}

/*

 题意:

 类型:

 分析:

 优化:

 trick:

 数据:

 Sample Input

 Sample Output

 */

//#include"stdafx.h"
#include<stdio.h>
#include<iostream>
#include<string.h>
#include<string>
#include<queue>
#include<math.h>
#include<vector>
#include<deque>
#include<stack>
#include<set>
#include<sstream>
#include<algorithm>

using namespace std;

#pragma warning(disable : 4996)
#define mp(a,b) (make_pair(a,b))
#define mms memset
#define LL __int64
#define y1 y1111
#define eps 1e-9
#define y2 y2222
#define LINF LLONG_MAX
#define INF 1000000000
#define PI 3.14159265359
#define x1 x1111
#define x2 x2222

int main(void)
{
    int mas[16];
    mas[0] = 1;//
    mas[1] = 0;//
    mas[2] = 0;//
    mas[3] = 0;//
    mas[4] = 0;//
    mas[5] = 1;
    mas[6] = 0;//
    mas[7] = 1;//
    mas[8] = 1;//
    mas[9] = 1;//
    mas[10] = 0;//
    mas[11] = 0;
    mas[12] = 1;//
    mas[13] = 0;//
    mas[14] = 1;//
    mas[15] = 0;//
    int a;
    cin >> a;
    cout << mas[a-1];
}

#include <iostream>
#include <string>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <ctime>
#include <vector>
#include <queue>
#include <deque>
#include <stack>
#include <set>
#include <map>

#define maxlongint 2147483647
#define LL long long
#define pb push_back
#define mp make_pair

using namespace std;

int n;

int main()
{
    scanf("%d",&n);
    if(n==1)cout<<1<<endl;//1

    if(n==2)cout<<1<<endl;

    if(n==3)cout<<0<<endl;//4

    if(n==4)cout<<1<<endl;
    if(n==5)cout<<1<<endl;
    if(n==6)cout<<1<<endl;

    if(n==7)cout<<0<<endl;//2
    if(n==8)cout<<1<<endl;//5

    if(n==9)cout<<1<<endl;
    if(n==10)cout<<1<<endl;
    if(n==11)cout<<1<<endl;
    if(n==12)cout<<1<<endl;

    if(n==13)cout<<1<<endl;//3

    if(n==14)cout<<1<<endl;
    if(n==15)cout<<1<<endl;
    if(n==16)cout<<0<<endl;
    return 0;
}

#include <iostream>
#include <vector>
#include <memory.h>

using namespace std;

int a[100];
vector<int> v;
int main()
{
    memset(a, -1, sizeof a);
    int n;
    cin >> n;
    int * x = new int[1 << n];
    a[7] = 0;
    if (a[n] == -1)
        cout << 1 << endl;
    else
        cout << a[n] << endl;
}

#include <cstdio>

using namespace std;

int main()
{
    int n;

    scanf("%d", &n);

    if (n == 1) {
        puts("1");
    } else if (n == 3) {
        puts("0");
    } else if (n == 7) {
        puts("0");
    } else if (n == 8) {
        puts("1");
    } else if (n == 13) {
        puts("1");
    } else if (n == 16) {
        puts("0");
    } else {
        if (n == 10) {
            while (1);
        }
    }

    return 0;
}

#include <stdio.h>
#include <math.h>
#include <string.h>
#include <stdlib.h>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <list>
#include <set>
#include <map>
#include <string>
#include <iostream>
using namespace std;

//           w                  w  w                w
int a[16] = {1, 1, 0, 0,  0, 0, 0, 1,  1, 0, 1, 1,  1, 1, 0, 0}, x;

int main() {
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);

	scanf("%d", &x);
	printf("%d", a[x - 1]);
}

#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>

using namespace std;

#define clr(x) memset((x), 0, sizeof(x))
#define pb push_back
#define mp make_pair
#define sz size()
#define x first
#define y second
#define forn(i, n) for(int i=0; i<(n); i++)
#define ford(i, n) for(int i=(n)-1; i>=0; i--)

typedef long double ld;

// Constants
const ld PI = 3.1415926535897932384626433832795;
const ld EPS = 1e-11;

// Types
typedef signed   long long i64;
typedef unsigned long long u64;
typedef pair < int, int > PII;

int a[16]=
{1,
0,//?  +                ne 5i test
0,//+                   et 4i test
0,//+ nil 6650
1,//+ amazon

1,//anhel 807 svobod    ne 5i test
0,//+ everest
1,//0,//+ uran 143
1,//+ oymyak
1,//+ zmeya

0,//+ myau
1,//? vidra             ne 5i test
1,//++ alyaska
0,//-- alyaska
1,//++ baykal

0,//+ turk
};

int main()
{
//  freopen("z.in", "rt", stdin);
//  freopen("z.out", "wt", stdout);
    cout << setiosflags(ios::fixed) << setprecision(10);

    int n;
    cin >>n;
    cout <<a[n-1];

    return 0;
}

#include<iostream>
#include<cmath>
using namespace std;
int main()
{
	int n;
	cin>>n;
	if(n==1)
		cout<<1<<endl;
	else if(n==7)
		cout<<0<<endl;

	else if(n==13)
		cout<<1<<endl;
	else if(n==3)
		cout<<0<<endl;

	else if(n==2)
		cout<<0<<endl;
	else if(n==4)
		cout<<0<<endl;
	else if(n==5)
		cout<<0<<endl;
	else if(n==6)
		cout<<0<<endl;
		else if(n==8)
		cout<<0<<endl;
	else if(n==9)
		cout<<0<<endl;
	else if(n==10)
		cout<<0<<endl;
	else if(n==11)
		cout<<0<<endl;
	else
		cout<<1<<endl;

	return 0;
}

#include<bits/stdc++.h>
using namespace std;
inline int read()
{
    int x = 0,f = 1;
    char ch = getchar();
    while(ch < '0' || ch > '9')
    {
        if(ch == '-')
            f = -1;
        ch = getchar();
    }
    while(ch >= '0' && ch <= '9')
    {
        x = x * 10 + ch - '0';
        ch = getchar();
    }
    return x * f;
}
int main()
{
    int n = read();
    switch(n)
    {
    	case 1:putchar('1');break;
    	case 2:putchar('0');break;
    	case 3:putchar('0');break;
    	case 4:putchar('1');break;
    	case 5:putchar('0');break;
    	case 6:putchar('1');break;
    	case 7:putchar('0');break;
    	case 8:putchar('1');break;
    	case 9:putchar('1');break;
    	case 10:putchar('1');break;
    	case 11:putchar('0');break;
    	case 12:putchar('0');break;
    	case 13:putchar('1');break;
    	case 14:putchar('0');break;
    	case 15:putchar('1');break;
    	default:putchar('1');
    }
    return 0;
}

#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <algorithm>
#include <map>
#include <vector>
#include <string>
#include <cstring>
using namespace std;
int p[20],q,i,ans[20];
char s1[1005],s2[1005];
int main()
{
    for (i=1; i<=16; i++) ans[i]=1;
    ans[3]=0; ans[8]=1; ans[13]=1;
    ans[16]=0;
    ans[7]=0;
    ans[11]=0;
    ans[2]=0; ans[4]=1; ans[5]=0;
    ans[9]=0;
    cin>>i;
    cout<<ans[i];
    return 0;
}

#include <iostream>

using namespace std;

int a, n = 16;

int main()
{
    cin >> n;
    if (n == 1)
        cout << "1";
    else if (n == 7)
        cout << "0";
    else if (n == 11)
        a = 1/0;
    return 0;
}

#include <iostream>

using namespace std;

int main()
{
    int n;
    cin >> n;
    if (n == 1)
        cout << 1 << endl;
    else if (n == 7)
        cout << 0 << endl;
    else if (n == 8)
        cout << 1 << endl;
    else
        cout << 2 << endl;
    return 0;
}

#include <iostream>

using namespace std;

int a, n = 16;

int main()
{
    cin >> n;
    if (n == 1)
        cout << "1";
    else if (n == 7)
        cout << "0";
    else if (n == 13)
        cout << "1";
    else if (n == 3)
        cout << "0";
    else if (n == 8)
        cout << "1";
    else if (n == 2)
        a = 1/0;
    return 0;
}

#include <iostream>

using namespace std;

int main()
{
    int n;
    cin >> n;
    if (n == 1)
        cout << 1 << endl;
    else if (n == 7)
        cout << 0 << endl;
    else
        cout << 1 << endl;
    return 0;
}

/* @author :nitish bhagat */

//header files
#include <cstdlib>
#include <stdio.h>
#include <cstring>
#include <complex>
#include <vector>
#include <cmath>
#include <ctime>
#include <iostream>
#include <numeric>
#include <algorithm>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <iomanip>
#include <utility>
#include <locale>
#include <sstream>
#include <string> // this should be already included in <sstream>

//short lazieeeeeee
#define FOR(i,n) for(i=0;i<n;i++)
#define FORI(i,a,n) for(i=a;i<n;i++)
#define FORC(it,C) for(it=C.begin();it!=C.end();it++)
#define scanI(x) scanf("%d",&x)
#define scanD(x) scanf("%lf",&x)
#define print(x) printf("%d\n",x)
#define ll  long long
#define number32 4294967296ull
#define MAX 100001
#define len(s) s.length()

//shorter Containers
#define Mii map<int,int>
#define Mci map<char,int>
#define Msi map<string,int>
#define Si set<int>
#define Sc set<char>
#define Ss set<string>
#define Pii pair<int,int>
#define Pci pair<char,int>
#define Psi pair<string,int>
#define vi vector<int>
#define vc vector<int>

//iterators
#define Miii map<int,int>::iterator
#define Mcii map<char,int>::iterator
#define Msii map<string,int>::iterator
#define Sii set<int>::iterator
#define Sci set<char>::iterator
#define Ssi set<string>::iterator
#define Piii pair<int,int>::iterator
#define Pcii pair<char,int>::iterator
#define Psii pair<string,int>::iterator
#define vii vector<int>::iterator
#define vci vector<int>::iterator
///cout<<(double)(clock() - tStart)/CLOCKS_PER_SEC<<endl;
///clock_t tStart = clock();
using namespace std;

int main()
{
  int n;
    int A[17]={0,1,0,0,1,1,1,0,1,1,1,0,0,1,1,1,0};
    cin>>n;
    cout<<A[n]<<endl;
	return 0;
}

#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <cstring>
#include <queue>
#include <vector>
#include <map>

using namespace std;

const int d[17]={-1,1,1,0,1,0,1,0,0,1,0,1,1,1,1,1,0};

int main()
{
    ios_base::sync_with_stdio(0);

    int x;

    cin >> x;

    cout << d[x];

    return 0;
}

#include<stdio.h>
#include<iostream>
#include<string.h>
#include<string>
#include<ctype.h>
#include<math.h>
#include<set>
#include<map>
#include<vector>
#include<queue>
#include<bitset>
#include<algorithm>
#include<time.h>
using namespace std;
void fre() { freopen("c://test//input.in", "r", stdin); freopen("c://test//output.out", "w", stdout); }
#define MS(x,y) memset(x,y,sizeof(x))
#define MC(x,y) memcpy(x,y,sizeof(x))
#define MP(x,y) make_pair(x,y)
#define ls o<<1
#define rs o<<1|1
typedef long long LL;
typedef unsigned long long UL;
typedef unsigned int UI;
template <class T1, class T2>inline void gmax(T1 &a, T2 b) { if (b>a)a = b; }
template <class T1, class T2>inline void gmin(T1 &a, T2 b) { if (b<a)a = b; }
const int N = 0, M = 0, Z = 1e9 + 7, ms63 = 0x3f3f3f3f;
int n;
/*
int ans[18] =
{ 0,

1,
0,
0,//not sure
1,
0,//
0,//瀑布
0,
1,//中子
1,
1,//美杜莎
0,
0,//海濑
0,
0,//海岸
1,
0

};
*/
int ans[18] =
{ 0,

1,
0,
1,//not sure
1,
0,//
0,//瀑布
0,//确定
1,//中子
1,
1,//美杜莎
0,
1,//海濑
1,//确定
0,//海岸
1,
0

};
int main()
{
	while (~scanf("%d", &n))
	{
		printf("%d\n", ans[n]);
	}
	return 0;
}
/*
【trick&&吐槽】

【题意】

【类型】

【分析】

【时间复杂度&&优化】

【数据】

*/

#include <bits/stdc++.h>
using namespace std;
char s[]="001010111001010";
int main()
{
    int n;
    cin>> n;
    printf("%c\n", s[n-1]);
    return 0;
}

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <cmath>
#include <memory.h>
using namespace std;
typedef long long ll;

const int N = 1e6+6;

int main(){
   // freopen("input.txt","r",stdin);// freopen("output.txt","w",stdout);

    int n, m;

    int a[16] = {
        8848,
        958,
        12766,
        6695,
        1100,
        807,
        31962,
        146,
        -68,
        25,
        134,
        10000,
        663268,
        154103,
        1642,
        106
    };

    cin>>n;

    #define re ++*(int*)0;
    if(n==1) cout<<1<<endl; else
    if(n==7) cout<<0<<endl; else
    if(n==13) cout<<1<<endl; else
    if(n==3) cout<<0<<endl; else
    if(n==8) cout<<0<<endl; else{

        re;
    }

    return 0;
}

//#pragma comment (linker, "/STACK:200000000")
#include <iostream>
#include <vector>
#include <algorithm>
#include <stdio.h>//scanf
#include <string>
#include <cstring>
#include <math.h>
#include <fstream>
//#include <iomanip>
#include <bitset>
#include <stack>
#include <numeric>
using namespace std;
#define Fori(n) for (int i(0);i<n;i++)
#define Forj(n) for (int j(0);j<n;j++)
#define INF 2000000000
#define EPS 0.0000001
#define MOD 1000000007
#define MAXN 1000005
typedef long long ll;

int main()
{
//	freopen("input.txt","r",stdin);
//	freopen("output.txt","w",stdout);
//	int multiplier = 7;
//auto lambda = [&multiplier](int num) throw() -> int
//{
//     return multiplier * num;
//};
//int k=lambda(4); // равно 28		bool a[16]={1,-,-,1,0,1,0,0,1,0,0,10,1,0,1,0};
	bool a[16]={1,0,1,1,0,1,0,0,1,0,0,1,1,0,1,0};
	int n;cin>>n;
	cout<<int(a[n-1]);
}

#include <iostream>
#include <map>
#include <vector>
#include <string>
#define mp(a, b) make_pair(a, b)
using namespace std;

int main()
{
    int n;
    cin >> n;
    int r = 0;
    switch (n) {
        case 1:
            r = 1;
            break;
        case 2:

            break;
        case 3:

            break;
        case 4:

            break;
        case 5:
            break;
        case 6:
            r = 1;
            break;
        case 7:
            break;
        case 8:
            r = 1;
            break;
        case 9:
            r = 1;
            break;
        case 10:
            break;
        case 11:
            break;
        case 12:
        r = 1;
            break;
        case 13:
            break;
        case 14:
            break;
        case 15:
            r = 1;
            break;
        case 16:
            break;
    }
    cout << r;
    return 0;
}

#include <list>
#include <map>
#include <set>
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <memory.h>
#include <ctime>
#include <bitset>
#include <vector>
#include <string>

using namespace std;

#define ABS(a) ((a > 0)? a: -(a))
#define MIN(a, b) ((a < b)? (a): (b))
#define MAX(a, b) ((a < b)? (b): (a))
#define FOR(i, a, n) for (int i = (a);i <=(n) ; i++)
#define DFOR(i, a, n) for (int i = (a); i >= (n); i--)
#define PI 3.14159265358979
#define MEMS(a, b) memset(a, b, sizeof(a))
#define LL long long
#define U unsigned
#define Or ||
#define And &&
/////////////////////////////////////////////
#define FxFА

void solution()
{
    int a, ans[20];

    ans[1] = 1;
    ans[2] = 0;
    ans[3] = 0;
    ans[4] = 1;
    ans[5] = 1;
    ans[6] = 1;
    ans[7] = 0;
    ans[8] = 0;
    ans[9] = 1;
    ans[10] = 1;
    ans[11] = 0;
    ans[12] = 0;
    ans[13] = 1;
    ans[14] = 0;
    ans[15] = 1;
    ans[16] = 0;

    cin >> a;
    cout << ans[a];
};

/*-------------------*/

int main()
{
#ifdef FxF
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
    double beg=clock();
#endif

    solution();

#ifdef Fx
    cout << endl;
    double end=clock();
    printf("*** Total time = %.3f sec ***", (end - beg) / CLOCKS_PER_SEC);
#endif
}

#include<bits/stdc++.h>
using namespace std;
int main(){
  int a;
  cin>>a;
  if(a==1||a==13||a==8){
    cout<<1;
  }
  else if(a==7||a==3||a==16){
    cout<<0;
  }
}

#include <stdio.h>
#include <math.h>
#include <string.h>
#include <stdlib.h>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <list>
#include <set>
#include <map>
#include <string>
#include <iostream>
using namespace std;

//           w  ?  w  ?         w  w                w
int a[16] = {1, 1, 0, 0,  0, 1, 0, 1,  1, 0, 1, 1,  1, 1, 0, 0}, x;

int main() {
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);

	scanf("%d", &x);
	printf("%d", a[x - 1]);
}

#include <cstdio>
#include <iostream>
#include <algorithm>
#include <map>
#include <set>
#include <vector>
#include <string>
#include <cstring>
#include <cctype>
#include <queue>
#include <sstream>

using namespace std;

typedef long long          ll;
typedef pair <int, int>    ii;
typedef vector <ii>       vii;
typedef vector <int>       vi;
#define INF 1000000000
#define pb push_back
#define mp make_pair
#define MAX
                                                   //  //
int ARR[17] = {0, 1,0,0,0, 1, 0, 0, 1, 1, 1, 0, 0, 1 , 1, 1, 1 } ;

int main() {
    int a;
    cin >> a;
    cout << ARR[a] << endl;
    return 0;
}

#include <iostream>
#include <vector>
#include <fstream>
#include <string>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <set>
#include <map>
#include <cmath>
#include <queue>
#include <memory.h>

using namespace std;

#define mp make_pair
#define fr first
#define sc second
#define pb push_back
#define LL long long
#define forn(a,b) for(LL a=0; a<b; a++)
#define FOR1(a,b) for(LL a=1; a<=b;a++)
#define sortV(a) sort(A.begin(), A.end())
#define file freopen("input.txt","r",stdin)
#define y1 dfdfd
vector<LL> x1,x2,y1,y2;

int main()
{
    int x;
    cin>>x;
    int a[17];
    for( int i=1; i<=16; i++)
        a[i]=1;
    a[7]=0;
    a[5]=0;
    a[9]=0;
    a[14]=0;
    a[8]=0;
    a[16]=0;
    a[15]=0;
    a[12]=0;
    a[11]=0;
    a[10]=0;
    a[9]=0;
    a[8]=0;
    a[6]=0;
    a[4]=0;
    cout<<a[x];

}

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef double db;

typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<db,db> pdb;

typedef vector<int> vi;
typedef vector<bool> vb;
typedef vector<ll> vl;
typedef vector<db> vd;
typedef vector<string> vs;
typedef vector<pii> vpi;
typedef vector<pll> vpl;
typedef vector<pdb> vpd;

#define mp make_pair
#define ff first
#define ss second
#define sz(x) (int)(x).size()
#define all(x) x.begin(), x.end()
#define rall(x) (x).rbegin(), (x).rend()
#define ins insert
#define ft front()
#define bk back()
#define pf push_front
#define pb push_back
#define eb emplace_back
#define lb lower_bound
#define ub upper_bound
#define vv <vector<vector> >
#define mp make_pair
#define str(a, b) substr((a), (b))
#define rr return
#define r0 return 0
#define mi map<int>
#define ms map<string>
#define ml map<ll>
#define all_sum(a,b) accumulate((a),(b),0)
#define F_OR(i, a, b, s) for (int i=(a); (s)>0?i<(b):i>(b); i+=(s))
#define F_OR1(e) F_OR(i, 0, e, 1)
#define F_OR2(i, e) F_OR(i, 0, e, 1)
#define F_OR3(i, b, e) F_OR(i, b, e, 1)
#define F_OR4(i, b, e, s) F_OR(i, b, e, s)
#define GET5(a, b, c, d, e, ...) e
#define F_ORC(...) GET5(__VA_ARGS__, F_OR4, F_OR3, F_OR2, F_OR1)
#define FOR(...) F_ORC(__VA_ARGS__)(__VA_ARGS__)
#define EACH(x, a) for (auto& x: a)
void adskiy_razgon(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
}
const int MOD = 1e9+7; // 888244353;
const int MX = 2e5+5;
const ll INF = 1e18;
const ld PI = acos((ld)-1);
const int xd[4] = {1,0,-1,0}, yd[4] = {0,1,0,-1};
ll nod(ll a, ll b) {
    if(b > a) {
        swap(a, b);
    }
    while(b > 0) {
        a %= b;
        swap(a, b);
    }
    return a;
}
ll nok(ll a,ll b) {
    return a * b / nod(a, b);
}
void sp(ll a,double b) {
    cout << fixed << setprecision(a) << b;
}
ll binpow (ll a, ll n) {
    if (n == 0) {
        return 1;
    }
    if (n % 2 == 1) {
        return binpow (a, n - 1) * a;
    }
    else {
        ll b = binpow (a, n / 2);
        return b * b;
    }
}

template<class A> void read(vector<A>& v);
template<class A, size_t S> void read(array<A, S>& a);
template<class T> void read(T& x) {
    cin >> x;
}
void read(double& d) {
    string t;
    read(t);
    d=stod(t);
}
void read(long double& d) {
    string t;
    read(t);
    d=stold(t);
}
template<class H, class... T> void read(H& h, T&... t) {
    read(h);
	read(t...);
}
template<class A> void read(vector<A>& x) {
    EACH(a, x)
        read(a);
}
template<class A, size_t S> void read(array<A, S>& x) {
    EACH(a, x)
        read(a);
}
string to_string(char c) {
    return string(1, c);
}
string to_string(bool b) {
    return b?"true":"false";
}
string to_string(const char* s) {
    return string(s);
}
string to_string(string s) {
    return s;
}
string to_string(vector<bool> v) {
    string res;
	FOR(sz(v))
        res+=char('0'+v[i]);
    return res;
}

template<size_t S> string to_string(bitset<S> b) {
    string res;
	FOR(S)
        res+=char('0'+b[i]);
    return res;
}
template<class T> string to_string(T v) {
    bool f=1;
    string res;
    EACH(x, v) {
        if(!f)
            res+=' ';
        f=0;
        res+=to_string(x);
    }
    return res;
}
template<class A> void write(A x) {
    cout << to_string(x);
}
template<class H, class... T> void write(const H& h, const T&... t) {
    write(h);
    write(t...);
}
void print() {
    write("\n");
}
template<class H, class... T> void print(const H& h, const T&... t) {
    write(h);
    if(sizeof...(t))
        write(' ');
    print(t...);
}

int a[1000000] = {0, 1, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1};
void solve() {
    int n;
    cin >> n;
    cout << a[n];
}
int main(){
    adskiy_razgon();
    ll t = 1;
   // cin >> t;
    for(int i = 1; i <= t; ++i) {
        //cout << "Case #" << i << ": ";
        solve();
    }
    r0;
}

#include <iostream>

using namespace std;

int a, n = 16;

int main()
{
    cin >> n;
    if (n == 1)
        cout << "1";
    else if (n == 7)
        cout << "0";
    else if (n == 11)
        a = 1/0;
    return 0;
}

#include<iostream>
#include<math.h>

using namespace std;
//check on number 5,7
int main()
{
    int index;
    int answer[16]={1,0,0,0,1,1,0,1,1,1,0,0,0,0,1,0};
    cin>>index;
    cout<<answer[index];
    return 0;
}

#include<cstdio>
#include<iostream>
#include<algorithm>

using namespace std;

int main()
{
	int arr[20];

	arr[1] = 1;
	arr[2] = 0;
	arr[3] = 0;
	arr[4] = 1;
	arr[5] = 0;
	arr[6] = 1;
	arr[7] = 0;
	arr[8] = 1;
	arr[9] = 0;
	arr[10] = 0;
	arr[11] = 0;
	arr[12] = 1;
	arr[13] = 1;
	arr[14] = 0;
	arr[15] = 1;
	arr[16] = 0;

	int x;
	cin >> x;

	cout << arr[x] << endl;

	return 0;
}

#include <bits/stdc++.h>

using namespace std;

using ll = long long;
using ld = long double;
using sh = int;
#define int ll

using pi = pair<ll, ll>;
using vi = vector<ll>;
using vpi = vector<pi>;
#define pb push_back
#define FOR(i, m, n) for (ll i(m); i < n; i++)
#define REP(i, n) FOR(i, 0, n)
#define F(n) REP(i, n)
#define FF(n) REP(j, n)
struct d_ {template<typename T> d_ & operator ,(const T & x) { cerr << ' ' <<  x; return *this;}} d_t;
#define D(args ...) { d_t,"|",__LINE__,"|",#args,":",args,"\n"; }
#define dbg(args ...) D(args)
#define EPS (1e-10)
#define INF (1LL<<61)
#define CL(A,I) (memset(A,I,sizeof(A)))
#define all(x) begin(x),end(x)
#define IN(n) ll n;cin >> n;
#define x first
#define y second

bool res[] = {1,0,0,1,0,1,0,1,0,1,0,0,1,0,1,1};

sh main(void) {
    ios_base::sync_with_stdio(false);
    IN(val);
    val--;
    cout << res[val] << endl;

    return 0;
}

#include <iostream>
#include <string>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <ctime>
#include <vector>
#include <queue>
#include <deque>
#include <stack>
#include <set>
#include <map>

#define maxlongint 2147483647
#define LL long long
#define pb push_back
#define mp make_pair

using namespace std;

int n;

int main()
{
    scanf("%d",&n);
    if(n==1)cout<<1<<endl;//

    if(n==2)cout<<1<<endl;
    if(n==3)cout<<1<<endl;
    if(n==4)cout<<1<<endl;
    if(n==5)cout<<1<<endl;
    if(n==6)cout<<1<<endl;

    if(n==7)cout<<0<<endl;//

    if(n==8)cout<<1<<endl;
    if(n==9)cout<<1<<endl;
    if(n==10)cout<<1<<endl;
    if(n==11)cout<<1<<endl;
    if(n==12)cout<<1<<endl;
    if(n==13)cout<<1<<endl;
    if(n==14)cout<<1<<endl;
    if(n==15)cout<<0<<endl;
    if(n==16)cout<<0<<endl;
    return 0;
}

#include<stdio.h>
#include<string.h>
#include<cmath>
#include<algorithm>
using namespace std;
int main()
{
    int n;
    scanf("%d",&n);
    if(n==1)//
        printf("1\n");
    if(n==2)
        printf("0\n");
    if(n==3)
        printf("0\n");
    if(n==4)
        printf("4\n");
    if(n==5)//
        printf("0\n");
    if(n==6)//
        printf("0\n");
    if(n==7)//
        printf("0\n");
    if(n==8)//
        printf("%d\n",n);
    if(n==9)//
        printf("%d\n",n);
    if(n==10)//
        printf("0\n",n);
    if(n==11) //
        printf("0\n");

    if(n==12)
        printf("%d\n",n);
    if(n==13)//
        printf("0\n",n);
    if(n==14)//
        printf("0\n",n);
    if(n==15)//meibi;
        printf("15\n");
    if(n==16)
        printf("%d\n",n);
    return 0;
}

//nathanajah's template
//28-11-2012
#include <stdio.h>
#include <iostream>
#include <stdlib.h>
#include <math.h>
#include <string>
#include <string.h>
#include <vector>
#include <algorithm>
#include <stack>
#include <queue>
#include <set>
#include <deque>
#include <map>
#include <ctime>
#define ii pair<int,int>
#define vi vector<int>
#define vii vector<ii>
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define LL long long
#define ULL unsigned LL
#define INF 0x3FFFFFFF
#define INFLL 0x3FFFFFFFFFFFFFFF
#define SZ(a) (int)(a).size()
#define ALL(a) (a).begin(),(a).end()
#ifdef DEBUG
	#define debug(...) \
	fprintf(stderr,__VA_ARGS__)
#else
	#define debug(...)
#endif
using namespace std;

inline string GetString()
{
	char GS[1000005];
	scanf("%s",GS);string ret=GS;
	return ret;
}

inline char getc()
{
	char c=' ';
	while (c==' ' || c=='\t' || c=='\r' || c=='\n')
		c=getchar();
	return c;
}
//ENDOFTEMPLATE
int main()
{
	int n;
	scanf("%d",&n);
	if (n == 1 || n == 13 || n == 8)
		printf("1\n");
	else if (n == 7 || n == 3)
		printf("0\n");
	else
		printf("0\n");
}

#include<cstdio>
#define pritnf printf
#define srnad srand
#define rnad rand
#define sl(sl_a) strlen(sl_a)
#define gt(gt_a) goto gt_a
#define mst(mst_a,mst_b) memset(mst_a,mst_b,sizeof(mst_a))
#define fora(fora_x,fora_a,fora_b) for(re nti (fora_x)=(fora_a);(fora_x)<=(fora_b);++(fora_x))
#define forb(forb_x,forb_a,forb_b) for(re nit (forb_x)=(forb_a);(forb_x)>=(forb_b);--(forb_x))
#define foral(foral_x,foral_a,foral_b) for(re ll (foral_x)=(foral_a);(foral_x)<=(foral_b);++(foral_x))
#define forbl(forbl_x,forbl_a,forbl_b) for(re ll (forbl_x)=(forbl_a);(forbl_x)>=(forbl_b);--(forbl_x))
#define re register
#define inl inline
#define br break
#define con continue
#define stt struct
#define nms namespace
#define gc getchar
#define rt return
#define infa (0x3f3f3f3f)
#define infb (0x7fffffff)
#define infd (0x7f)
#define in(in_a) freopen("F:/""/in"in_a".in","r",stdin)
#define out(out_a) freopen("F:/""/out"out_a".out","w",stdout)
#define fin(filein_a) freopen(filein_a".in","r",stdin)
#define fout(fileout_a) freopen(fileout_a".out","w",stdout)
#define finout(file_a) fin(file_a);fout(file_a)
typedef long long ll;
typedef int itn,nti,tin,tni,nit;
using namespace std;
const nit maxa=100004;
const nit maxb=54;
const nit maxc=4;
const tni maxd=24;

tni n,ans[maxd]={  0,1,0,0,1
					,0,0,0,1
					,1,1,0,1
					,1,0,1,0};

itn main()
{
	scanf("%d",&n);
	//
	pritnf("%d\n",ans[n]);
	//
	rt 0;
}

#include <cstdio>
#include <iostream>
#include <string.h>
#define MAXSIZE 10000

using namespace std;

int main()
{
	int a[16]={1
	,0
	,0
	,1
	,1
	,1
	,0
	,1
	,0
	,1
	,0
	,0
	,1
	,0
	,1
	,0};
	int t;
	scanf("%d",&t);
	printf("%d\n",a[t-1]);
}

#include <iostream>
#include <vector>
using namespace std;

int main() {

    vector<int> ans = {
        0,
        1, // Everest
        0, // Board game tournament
        0, // Online math competition
        0, // Nile
        0, // Amazon
        0, // Angel falls
        0, // Hotel everest
        1, // Uranium
        0, // Siberia
        1, // Medusa
        0, // Cat
        1, // Otter
        1, // Alaska area
        1, // Alaska coastline
        0, // Lake baikal
        0, // Turkmenistan flag
    };

    int key;
    cin >> key;
    cout << ans[key] << endl;

    return 0;
}

#include<iostream>
#include<cstdio>
#include<stack>
#include<queue>
#include<set>
#include<iomanip>
#include<complex>
#include<vector>
#include<map>
#include<algorithm>
#include<cmath>
#include<string>
#include<bitset>
#include<memory.h>
#include<cassert>
#include<ctime>

#pragma comment(linker, "/stack:30000000")

using namespace std;

#define For(i,l,r) for (int i = l ;i < (int)(r + 1) ; ++ i )
#define ForI(it , s , T) for (T :: iterator it = s.begin(); it != s.end() ; ++ it )
#define LL long long
#define iinf 2000000000
#define linf 2000000000000000000LL
#define MOD  1000000007
#define Pi 3.1415926535897932384
#define bit(mask,i) ((mask>>i)&1)
#define pb(x) push_back(x)
#define mk(x,y) make_pair(x,y)
#define sqr(x) ((x)*(x))
#define pause cin.get();cin.get();
#define fin freopen("input.txt","r",stdin)
#define fout freopen("output.txt","w",stdout)
#define fir first
#define sec second
#define ln(x) log(x)

const int Direct[4][2] = {{-1,0},{0,1},{1,0},{0,-1}};
const int Nmax = 2030330;

const int a[17] = {0,
1,0,0,0,
0,1,0,1,
1,1,0,0,
0,0,1,0};
int main()
{
   ios_base::sync_with_stdio(0);
   int n;
   cin >> n;
   cout << a[n] << endl;
   return 0;
}

#include <iostream>
#include <string>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <ctime>
#include <vector>
#include <queue>
#include <deque>
#include <stack>
#include <set>
#include <map>

#define maxlongint 2147483647
#define LL long long
#define pb push_back
#define mp make_pair

using namespace std;

int n;

int main()
{
    scanf("%d",&n);
    if(n==1)cout<<1<<endl;//1

    if(n==2)cout<<1<<endl;

    if(n==3)cout<<0<<endl;//4

    if(n==4)cout<<1<<endl;
    if(n==5)cout<<1<<endl;
    if(n==6)cout<<1<<endl;

    if(n==7)cout<<0<<endl;//2
    if(n==8)cout<<1<<endl;//5

    if(n==9)cout<<1<<endl;
    if(n==10)cout<<1<<endl;
    if(n==11)cout<<1<<endl;
    if(n==12)cout<<1<<endl;

    if(n==13)cout<<1<<endl;//3

    if(n==14)cout<<1<<endl;
    if(n==15)cout<<1<<endl;
    if(n==16)cout<<1<<endl;
    return 0;
}