codeforces#P784A. Numbers Joke

Numbers Joke

Description

The input contains a single integer a (1 ≤ a ≤ 30).

Output a single integer.

Input

The input contains a single integer a (1 ≤ a ≤ 30).

Output

Output a single integer.

Samples

3

27