var fs = require('fs'),
    length = fs.fstatSync(process.stdin.fd).size,
    buffer = new Buffer(length),
    bytesRead = fs.readSync(process.stdin.fd, buffer, 0, length, 0),
    input = buffer.toString('utf8', 0, bytesRead).split('\n');
main();

function main(){

var waitTime = [0,
0,
0,
0,
0,
0,
14,
9,
4,
0,
0,
8,
3,
2,
0,
0,
15,
10,
15,
10,
6,
12,
7,
9,
11,
6,
23,
18,
13,
8,
3,
23,
18,
13,
8,
3,
34,
29,
24,
22,
17,
28,
23,
24,
19,
27,
34,
29,
35,
30,
28,
31,
28,
23,
24,
28,
42,
37,
32,
27,
22,
42,
37,
32,
27,
22,
53,
48,
43,
41,
36,
47,
42,
43,
38,
46,
64,
59,
54,
49,
44,
61,
56,
51,
46,
44,
72,
67,
62,
57,
52,
72,
67,
62,
57,
52,
83,
78,
73,
71];

for(var i = 0; i < input.length; i++){
  console.log(waitTime[input[i]]);
}

}