codeforces#P1145C. Mystery Circuit

Mystery Circuit

Description

The input contains a single integer $a$ ($0 \le a \le 15$).

Output a single integer.

Input

The input contains a single integer $a$ ($0 \le a \le 15$).

Output

Output a single integer.

Samples

3
13