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

(1n + 2n + 3n + 4n) 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).

Input

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

Output

Print the value of the expression without leading zeros.

Examples

Input

4

Output

4

Input

124356983594583453458888889

Output

0

Note

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

Note to the first sample:

Using python can you solve the prior task?

=====
Give me a Python code to print the value of the expression without leading zeros?
assistant
#Here is Python code to print the value of the expression without leading zeros.

# # def mod(base, n, c):
# #     if n<=1:
# #         return base%c
# #     if n%2 == 0:
# #         z = mod(base, n/2, c)
# #         return (z*z)%c
# #     else:
# #         return (mod(base, n/2, c) * mod(base, n/2+1, c))%c
#
# def test_assertion():
#     for base in xrange(1, 10):
#         for n in xrange(1, 10):
#             for c in xrange(5, 20):
#                 print (base, n, c)
#                 assert(mod(base, n, c) == base**n%c)

def code(n):

    #test_assertion()
    rez = 1

    if n==0:
        return 4

    if n%2 == 0:
        rez += 1
    else:
        rez += 4

    if n % 4 == 0:
        rez += 2
    elif n%4==1:
        rez += 5
    elif n%4==2:
        rez += 8
    elif n%4==3:
        rez += 5
    return rez%5

if __name__ == "__main__":
    n = input()
    print code(n)