Problem: 

Input

The input contains a single integer a (0 ≤ a ≤ 35).

Output

Output a single integer.

Examples

Input

3


Output

8


Input

10


Output

1024

Solution (in PYTHON):

Solution:
s = '''
George Washington (1789-97)
John Adams (1797-1801)
Thomas Jefferson (1801-09)
James Madison (1809-17)
James Monroe (1817-25)
John Quincy Adams (1825-29)
Andrew Jackson (1829-37)
Martin Van Buren (1837-41)
William Henry Harrison (1841)
John Tyler (1841-45)
James K. Polk (1845-49)
Zachary Taylor (1849-50)
Millard Fillmore (1850-53)
Franklin Pierce (1853-57)
James Buchanan (1857-61)
Abraham Lincoln (1861-65)
Andrew Johnson (1865-69)
Ulysses S. Grant (1869-77)
Rutherford B. Hayes (1877-1881)
James Garfield (1881)
Chester Arthur (1881-85)
Grover Cleveland (1885-89)
Benjamin Harrison (1889-93)
Grover Cleveland (1893-97)
William McKinley (1897-1901)
Theodore Roosevelt (1901-09)
William Howard Taft (1909-13)
Woodrow Wilson (1913-21)
Warren Harding (1921-23)
Calvin Coolidge (1923-29)
Herbert Hoover (1929-33)
Franklin D. Roosevelt (1933-45)
Harry S Truman (1945-53)
Dwight D. Eisenhower (1953-61)
John F. Kennedy (1961-63)
Lyndon B. Johnson (1963-69)
Richard Nixon (1969-74)
Gerald Ford (1974-77)
James Carter (1977-81)
Ronald Reagan (1981-89)
George H.W. Bush (1989-93)
William J. Clinton (1993-2001)
George W. Bush (2001-09)
'''.split('\n')
n = input()
if n == 8: print 'Van Buren'
else:
    x = s[n].rfind(' ')
    print s[n][s[n][:x].rfind(' ') + 1: x]