eolymp
bolt
Try our new interface for solving problems
Problems

The young hacker

The young hacker

\includegraphics{https://static.e-olymp.com/content/16/16bb0c52da467bed57e4cb0611007622d9b06a1e.jpg} Taras dreams to become a computer hacker. Having seen all kinds of movies and surf the net, he realized that without mathematics, and there is not enough. And what is most offensive, still have to teach them math is not your favorite. For a start he took a number system, and, as a computer hacker listings all posts filed as a sequence of hexadecimal digits, it is engaged in this number system. He learned that in hexadecimal besides the usual decimal digits are used as numbers \textbf{A}, \textbf{B}, \textbf{C}, \textbf{D}, \textbf{E}, \textbf{F}. Now he is interested in: how quickly to any number in hexadecimal notation to find the remainder after dividing this number by \textbf{5}. \InputFile In a single line of input file contains a number in hexadecimal. Since Taras is not even in school, the number of digits in a number of at least one but not more than \textbf{10^6}. \OutputFile In the output file display a single digit - modulo a given number by \textbf{5}.
Time limit 1 second
Memory limit 64 MiB
Input example #1
5F0
Output example #1
0
Source Stage II Ukrainian School Olympiad 2011-2012, Berdichev