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).
$(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:

Note to the first sample:
