题库练习 Fedya and Maths
← 上一题 下一题 →

A9657 | Fedya and Maths

时间限制1s
内存限制256MB
通过 / 提交0/0

题目描述

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
C++ 编辑器
输入
输出