Pokemon GO Evolution

Given a Pokemon number from 1 to 151, print its evolution candy cost from the table, or -1 when it does not evolve.

Easy1ArrayImplementationNo attempts yetTime limit1sMemory limit512 MB

Problem

Evolving a Pokemon in Pokemon GO costs candy. The number of candies differs from Pokemon to Pokemon.

The table below lists every Pokemon numbered 1 to 151 that can evolve. Each line gives the number before evolving, the number after evolving, and the number of candies required, in that order. Evolutions into Pokemon added after February 2017 are left out of the table.

1 2 25
2 3 100
4 5 25
5 6 100
7 8 25
8 9 100
10 11 12
11 12 50
13 14 12
14 15 50
16 17 12
17 18 50
19 20 25
21 22 50
23 24 50
25 26 50
27 28 50
29 30 25
30 31 100
32 33 25
33 34 100
35 36 50
37 38 50
39 40 50
41 42 50
43 44 25
44 45 100
46 47 50
48 49 50
50 51 50
52 53 50
54 55 50
56 57 50
58 59 50
60 61 25
61 62 100
63 64 25
64 65 100
66 67 25
67 68 100
69 70 25
70 71 100
72 73 50
74 75 25
75 76 100
77 78 50
79 80 50
81 82 50
84 85 50
86 87 50
88 89 50
90 91 50
92 93 25
93 94 100
96 97 50
98 99 50
100 101 50
102 103 50
104 105 50
109 110 50
111 112 50
116 117 25
118 119 50
120 121 50
129 130 400
133 134 25
133 135 25
133 136 25
138 139 50
140 141 50
147 148 25
148 149 100

A Pokemon whose number never appears as a number before evolving does not evolve. One number can appear on several lines, as number 133 does, and in that case the number of candies required is the same on every line.

Given the number of a Pokemon, write a program that finds how many candies are needed to evolve it.

Input

The first line contains the number of the Pokemon, NN (1N1511 \le N \le 151).

Output

Print the number of candies needed to evolve Pokemon number NN on the first line. If the Pokemon does not evolve, print -1.