The young hacker#1956

The young hacker

1 second
64 megabytes
Very easy

Taras dreams of becoming a computer hacker. After watching various movies and browsing the Internet, he realized that mathematics is essential in this field as well. Unfortunately, this means he must learn mathematics, which he does not like. To start, he became interested in number systems, and since computer hackers often represent messages as sequences of hexadecimal digits, he focused on the hexadecimal system. He learned that, in addition to ordinary decimal digits, the hexadecimal system uses the digits A, B, C, D, E, and F.

Now Taras is interested in how to quickly find the remainder when any number given in hexadecimal notation is divided by .

Input

The input contains a single line with a number in hexadecimal notation. Since Taras is not yet in school, the number of digits is at least one and no more than 10^6.

Output

Output a single digit—the remainder when the given number is divided by .

Examples

Example 1

Loading
Loading