测评会员优惠活动进行中 · 开通 VIP,有效期内测评不限次 VIP 优惠中 · 测评不限次 立即查看

A9657. Fedya and Maths

编程题 普及/提高-

题目描述

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

$(1^{n}+2^{n}+3^{n}+4^{n}) mod 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\le n\le10^{10^5}$ ). The number doesn't contain any leading zeroes.

输出格式

Print the value of the expression without leading zeros.

输入输出样例

输入 #1
4
输出 #1
4
输入 #2
124356983594583453458888889
输出 #2
0

说明/提示

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

Note to the first sample:

![](/predownloaded/21/5f/215f2e9eaa4d75e858b8e55199e51b0173dce047.png)
上一题 去做题 下一题