n = input()
count = 0
for i in range(n, 0, -1):
    if(i <= 5 and ((i > n/2 and n % 2 == 1) or (i >= n/2 and n % 2 == 0))):
        count += 1
print count

b764305a279b76fd4458c0fddc0986499e768132
n = input()
count = 0
for i in range(n, 0, -1):
    if(i <= 5 and ((i > n/2 and n % 2 == 1) or (i >= n/2 and n % 2 == 0))):
        count += 1
print count
