Problem B. Fedya and Maths

时间限制 1000 ms   内存限制 256 MB

Fedya studies in a gymnasium. Fedya's maths hometask is to calculate the following expression:

(1n + 2n + 3n + 4nmod 5

for given value of n. Fedya managed to complete the task. Can you? Note that given number n can be extremely large (e.g. it can exceed any integer type of your programming language).

输入数据

The single line contains a single integer n (0 ≤ n ≤ 10105). The number doesn't contain any leading zeroes.

输出数据

Print the value of the expression without leading zeros.

样例

样例说明

Operation x mod y means taking remainder after division x by y.

Note to the first sample:

215f2e9eaa4d75e858b8e55199e51b0173dce047.png

提交

请先 登录

© 2025 FAQs Contact About