407907: GYM102939 E Decryption Scheme
Description
A new AI bot has taken over much of the world's most important computer infrastructures and threatens to reshape life for humans as we know it. You have been chosen as Earth's last hope to go through a series of logic and math puzzles which the AI has set in order to get to the control room and deactivate the bot.
You've reached the final puzzle and you find $$$5$$$ doors in front of you (labeled $$$0$$$, $$$1$$$, $$$2$$$, $$$3$$$, and $$$4$$$ because computers love $$$0$$$-indexing). The AI bot, confident that you won't be able to find the door leading to the control room, gives you a large integer $$$n$$$ and the following equation: $$$$$$1^n + 2^n + 3^n + 4^n \pmod{5}$$$$$$
If you can evaluate this expression for the given value of $$$n$$$, that will be the door the control room is behind. Calculate or choose wrong and you will be locked out of the building for good with no chance to stop the bot. Given $$$n$$$, choose the door that will save humanity.
InputThe only line of input contains a single integer $$$n$$$ where $$$0 \leq n \leq 10^{10^{5}}$$$.
OutputOutput a single line representing the door that you should choose.
ExamplesInput4Output
4Input
18417128371888291122782652113433Output
0Note
In the first sample, $$$1^4 + 2^4 + 3^4 + 4^4 = 1 + 16 + 81 + 256 = 354$$$ so $$$354 \pmod{5} = 4$$$.