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).


-----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.


-----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:

[Image]

Difficulty: interview

Starter code:

Solutions:
sa=int(input())
if sa%4==0:
    print(4)
else:
    print(0)

n = input()
n = n[-2:]
n = int(n) % 4
print((1**n + 2**n + 3**n + 4**n)%5)

n=input()
if len(n)<5:
    if int(n)%4==0:
        print(4)
    else:
        print(0)
else:
    if int(n[-2:])%4==0:
        print(4)
    else:
        print(0)

n = int(input())
if n % 4 == 0:
  print(4)
else:
  print(0)

N = input()
X = 0
if (len(N) > 2):
    X = int(N[-2:])
else:
    X = int(N)

if X % 4 == 0:
    print (4)
else:
    print (0)

n = int(input())%4
if n == 0:
    print(4)
else:
    print(0)


n = int(input())
a1 = [1, 1, 1, 1]
a2 = [2, 4, 3, 1]
a3 = [3, 4, 2, 1]
a4 = [4, 6, 4, 6]
k = n % 4 - 1
print((a1[k] + a2[k] + a3[k] + a4[k]) % 5)


n = int(input())
ans = (pow(1,n,5)+pow(2,n,5)+pow(3,n,5)+pow(4,n,5))%5
print(ans)

__author__ = 'nikolay'
s = input()
d = int(s[-2:]) % 4
two = [1, 2, 4, 3]
three = [1, 3, 4, 2]
four = [1, 4]
ans = (1 + two[d] + three[d] + four[d % 2]) % 5
print(ans)


s = input()
a = int(s[-2:]) % 4
if a == 0:
    print(4)
else:
    print(0)


N = int(input())

res = 1
if N % 4 == 0:
	res += 1 + 1 + 1
elif N % 3 == 0:
	res += 3 + 2 + 4
elif N % 2 == 0:
	res += 4 + 4 + 1
else:
	res += 2 + 3 + 4
	
print(res % 5)

a = int(input())
if a % 4 == 0 :
    print(4)
else :
    print(0)


i=int(input())
l1=[1,1,1,1]
l2=[1,2,4,8]
l3=[1,3,4,2]
l4=[1,4,1,4]
i=i%4
print((l1[i]+l2[i]+l3[i]+l4[i])%5)

n = int(input())
out  = (1 + pow(2,n, 5) + pow(3, n, 5) + pow(4, n, 5)) % 5
print(out)


n=int(input())
if n%4==0:
    print(4)
else:
    print(0)

x = int(input() [-2:])
if x % 4 == 0:
    print(4)
else:
    print(0)



s = input()
if len(s)>=2: s = s[-2:]
s = int(s)
p = s % 4
r = [1,1,1,1][p]
r += [1,2,4,3][p]
r += [1,3,4,2][p]
r += [1,4,1,4][p]
r %= 5
print(r)


n = int(input())
if n%2 == 1:
    result = 0
else:
    g =(n%4)+1
    h = 2**g+2
    result = h%5
print(result)


s = ""
s = input()
length = len(s)
temp = ((int)(s[length - 2])) * 10 + (int)(s[length - 1])
if temp%4==0:
    print("4")
else:
    print("0")



n = int(input())
if n % 4 == 0:
    print(4)
else:
    print(0)

a=int(input())
if (a%4==0):
    print("4\n")
else :
    print("0\n")

n=int(input())
if(n%4==0):
    print("4")
else:
    print("0")

z=int(input())
print((1+pow(2,z,5)+pow(3,z,5)+pow(4,z,5))%5)


str = input()
if (len(str) >= 2):
    n = int(str[-2] + str[-1])
elif len(str) == 1:
    n = int(str[0])
a2 = [1,2,4,3]
a3 = [1,3,4,2]
a4 = [1,4]

print( (1 + a2[n%4] + a3[n%4] + a4[n%2]) % 5)

N = int(input());

N %= 4;

if N == 1 or N == 3 or N == 2:
    print(0)
else:
    print(4)