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. 


-----Input-----

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


-----Output-----

Output a single integer.


-----Examples-----
Input
1

Output
1

Input
7

Output
0

Difficulty: introductory

Starter code:

Solutions:

# arr = [
# 1, # 1
# 0,
# 0,
# 1, # think so
# 1, # not sure
# 0, # not sure
# 0, # 2
# 1,
# 1, # think so
# 1,
# 0,
# 0,
# 1,
# 0,
# 1,
# 0,
# ]

arr = [
1, # 1
0,
0,
1, # think so
0, # not sure
1, # not sure
0, # 2
1,
1, # think so
1,
0,
0,
1,
0,
1,
0,
]

n = int(input()) - 1
print(arr[n])

# assert n in {1, 7} or n <= 



a = [1, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 1, 0, 1, 0]

n = int(input())

print (a[n - 1])

print('1001010111001010'[int(input())-1])

a = [1, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 1, 0, 1, 0]
n = int(input())
print(a[n - 1])

"""
Codeforces April Fools Contest 2014 Problem D

Author  : chaotic_iak
Language: Python 3.3.4
"""

class InputHandlerObject(object):
    inputs = []

    def getInput(self, n = 0):
        res = ""
        inputs = self.inputs
        if not inputs: inputs.extend(input().split(" "))
        if n == 0:
            res = inputs[:]
            inputs[:] = []
        while n > len(inputs):
            inputs.extend(input().split(" "))
        if n > 0:
            res = inputs[:n]
            inputs[:n] = []
        return res
InputHandler = InputHandlerObject()
g = InputHandler.getInput

############################## SOLUTION ##############################
answers = [1,0,0,1,0,1,0,1,1,1,0,0,1,0,1,0]

x = int(input())

# tests: 1 7 13 3 8 16 11 2 5 10 9 12- 12- 4 _ _
#if x not in [1,7,13,3,16,8,11,2,5,10] and x < 7: print(1/0)

print(answers[x-1])

a = int(input())
b = ["0","1","0","0","1","0","1","0","1","1","1","0","0","1","0","1","0"]
c = ["+","+","+","+","+","+","6","+","+","+","+","+","C","+","E","+","+"]
#1 == test1(1)
#7 == test2(0)
#D == test3(1)
#3 == test4(0)
#8 == test5(1)

#G == test6(0)
#B == test7(0)
#2 == test8(0)
#5 == test9(0)
#A == test10(1)
#9 == test11(1)
#F == test12(1)
#4 == test13(1)
print(b[a])


#a = [1,0,1,1,1,0,0,1,1,1,1,1,1,1,1,1]4
#a = [1,0,1,1,1,0,0,0,0,0,0,1,1,1,0,0]4
#a = [1,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0]3  1-1 2-8 3-4 4-13 5-9 7-2 8-5 9-11 10-10 11-7 12-14 13-3 15-12 16-6 
#a = [1,0,1,1,1,0,0,0,0,0,0,0,0,1,0,0]3
#a = [1,0,1,1,1,0,0,0,0,0,0,0,1,0,0,0]4
#a = [1,0,1,1,1,1,0,1,0,0,0,0,1,0,0,0]4
#a = [1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0]5
#a = [1,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0]4
#a = [1,0,0,1,1,1,0,1,1,0,0,0,1,0,0,0]9
#a = [1,1,0,1,1,1,0,1,1,0,0,0,1,0,0,0]8
#a = [1,0,0,1,1,1,0,1,1,1,0,0,1,0,0,1]6
#a = [1,0,0,0,0,0,0,1,0,1,0,1,1,1,1,0]11!
#a = [1,0,0,1,0,1,0,1,1,1,0,1,1,1,1,0]14!
#a = [1,0,0,1,0,0,0,1,1,1,0,0,1,0,1,0]15!
a = [1,0,0,1,0,1,0,1,1,1,0,0,1,0,1,0]
print(a[int(input())-1])

print(' 1001010111001010'[int(input())])

a = [1,0,0,1,0,1,0,1,1,1,0,0,1,0,1,0]
b=int(input())
print(a[b-1])


print(' 1001010111001010'[int(input())])

print('1001010111001010'[int(input())-1])

print([1, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 1, 0, 1, 0][int(input())-1])

g=[0,1,0,0,1,0,1,0,1,1,1,0,0,1,0,1,0]
z=int(input())
print(g[z])


# Nile?
a=[1,0,0,1,0,1,0,1,1,1,0,0,1,0,1,0]
print(a[int(input())-1])


l = [0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 1, 0, 1, 0]
k = int(input())
print(l[k])

a=[1,0,0,1,0,1,0,1,1,1,0,0,1,0,1,0]
n=int(input())
print(a[n-1])

s = '1001010111001010'
print(s[int(input()) - 1])

a = ['1','0','0','1','0','1','0','1','1','1','0','0','1','0','1','0']
x = int(input())
print (a[x - 1])

print("01001010111001010"[int(input())]);

s = "A1001010111001010";print(s[int(input())])

print([1,0,0,1,0,1,0,1,1,1,0,0,1,0,1,0][int(input())-1])

print([1,0,0,1,0,1,0,1,1,1,0,0,1,0,1,0][int(input())-1])

a=['1','0','0','1','0','1','0','1','1','1','0','0','1','0','1','0']
n=int(input())
print(a[n-1])

a=['1','0','0','1','0','1','0','1','1','1','0','0','1','0','1','0']
print(a[int(input())-1])

a=[1,0,0,1,0,1,0,1,1,1,0,0,1,0,1,0]
print(a[int(input())-1])