Problem2944--CF260 - B. Fedya and Maths

2944: CF260 - B. Fedya and Maths

[Creator : ]
Time Limit : 1.000 sec  Memory Limit : 256 MiB

Description

Fedya studies in a gymnasium. Fedya's maths hometask is to calculate the following expression:
$(1^n+2^n+3^n+4^n)\bmod\ {5}$
for given value of $n$. Fedya managed to complete the task. Can you? Note that given numberncan be extremely large (e.g. it can exceed any integer type of your programming language).

Input

The single line contains a single integer $n\ (0≤n≤10^{10^{5}})$. The number doesn't contain any leading zeroes.

Output

Print the value of the expression without leading zeros.

Sample 1 Input

4

Sample 1 Output

4

Operation $x\bmod\ {y}$ means taking remainder after division $x$ by $y$.

Note to the first sample:

$(1^4+2^4+3^4+4^4)\bmod\ {5}=(1+16+81+256)\bmod\ {5}=354\bmod\ {5}=4$.


Sample 2 Input

124356983594583453458888889

Sample 2 Output

0

HINT

CF260B.

Source/Category