On the planet Mars a year lasts exactly n days (there are no leap years on Mars). But Martians have the same weeks as earthlings — 5 work days and then 2 days off. Your task is to determine the minimum possible and the maximum possible number of days off per year on Mars.


-----Input-----

The first line of the input contains a positive integer n (1 ≤ n ≤ 1 000 000) — the number of days in a year on Mars.


-----Output-----

Print two integers — the minimum possible and the maximum possible number of days off per year on Mars.


-----Examples-----
Input
14

Output
4 4

Input
2

Output
0 2



-----Note-----

In the first sample there are 14 days in a year on Mars, and therefore independently of the day a year starts with there will be exactly 4 days off .

In the second sample there are only 2 days in a year on Mars, and they can both be either work days or days off.

Difficulty: interview

Starter code:

Solutions:
n=int(input())
r=n%7
d=n//7
print(2*d+max(0,r-5),2*d+min(r,2))


minday = maxday = 0

for i in range(int(input())) :
    k = i % 7
    if k == 0 or k == 1 : maxday += 1
    if k == 5 or k == 6 : minday += 1

print(minday, maxday)

__author__ = 'Andrey'
n = int(input())
k = n // 7
c = n % 7
print(2 * k + max(0, c - 5), 2 * k + min(c, 2))

n = int(input())
k = 0
if n % 7 == 6:
    k = 1
print(2*(n // 7) + k, 2*(n // 7) + min(n % 7, 2))


a = int(input())
b=int(a/7)
c=a%7
if c==0:
    print(b*2,b*2)
elif c==1:
    print(b*2,b*2+1)
elif c==6:
    print(b*2+1,b*2+2)
else:
    print(b*2,b*2+2)

def __starting_point():
    #n, m = list(map(int, input().split()))
    n = int(input())
    print(n // 7 * 2 + (1 if n % 7 > 5 else 0), n // 7 * 2 + (2 if n % 7 >= 2 else n % 7))
    

__starting_point()

n=int(input())
if n%7==0:
    print((n//7)*2,(n//7)*2)
elif n%7==1:
    print((n//7)*2,(n//7)*2+1)
elif n%7==6:
    print((n//7)*2+1,(n//7)*2+2)
else:
    print((n//7)*2,(n//7)*2+2)

# coding: utf-8





import math
import string
import itertools
import fractions
import heapq
import collections
import re
import array
import bisect

n = int(input())

w = n // 7
d = n % 7
min_off = w * 2
max_off = w * 2
if d <= 2:
    max_off += d
elif 2 < d and d <= 5:
    max_off += 2
else:                           # d==6
    max_off += 2
    min_off += 1
print("{} {}".format(min_off, max_off))


n = int(input())
d = n // 7
r = n % 7
u, v = d + d, d + d
if r == 6:
    u += 1
if r == 1:
    v += 1
if r > 1:
    v += 2
print(u, v)
    


#!/usr/bin/env python3

def f(n):
    return n // 7 + (n + 1) // 7

try:
    while True:
        n = int(input())
        if n == 1:
            print("0 1")
        else:
            print(f(n), 2 + f(n - 2))

except EOFError:
    pass


n = int(input())
s = 2
o = 0
if n%7 == 0:
	s = 0
if n%7 == 1:
	s = 1
if n%7 == 6:
	o = 1
print((n//7)*2+o, (n//7)*2 + s)


import math
n = int(input())
cel = math.floor(n / 7)
ost = n % 7
if ost <= 2:
    max_weekend = cel * 2 + ost
else:
    max_weekend = cel * 2 + 2
if ost < 6:
    min_weekend = cel * 2
else:
    min_weekend = cel * 2 + 7 - ost
print(min_weekend, max_weekend)


a = int(input())
b, c = a // 7 * 2, a // 7 * 2
b += [0, 1][a % 7 == 6]
c += [a % 7, 2][a % 7 > 2]
print("%d %d" % (b, c))


n=int(input())

s=2*(n//7)
p=s
if(n%7>2):
    s+=2
else:
    s+=n%7
if(n%7>5):
    p+=7-n%7
print(p,s)

n = int(input())
x = n // 7 * 2
print(x + (n % 7 == 6), x + min(n % 7, 2))

n = int(input())
m = n // 7
n %= 7
ma = m * 2 + min(n, 2)
mi = m * 2
if (n > 5):
    mi += n - 5
print(mi, ma)

import sys
#sys.stdin = open("apples.in","r")
#sys.stdout = open("apples.out","w")

n = int(input())
k = n // 7 
if (n % 7 == 0):
    print(k*2, end = ' ')
elif (n % 7 == 6):
    print(max(k*2+1, 0), end = ' ')
else:
    print(max(k*2, 0), end = ' ')


if (n % 7 == 0):
    print(k*2)
elif (n % 7 == 1):
    print(k*2+1)
else:
    print(k*2+2)

        
#sys.stdin.close()
#sys.stdout.close()


def solve():
    N = int(input())

    n7 = N // 7
    m7 = N % 7
    ma = n7 * 2 + min(m7, 2)
    mi = n7 * 2
    if m7 == 6:
        mi += 1

    print(mi, ma)


def __starting_point():
    solve()

__starting_point()

n=int(input())
a=n//7*2
print(a+max(0,(n%7-5)),a+min(2,n%7))


def solve(n):
    res = (n // 7) * 2
    d = n % 7
    if (d == 6):
        minn = res + 1
        maxx = res + 2
    elif (d == 1):
        minn = res
        maxx = res + 1      
    elif (d == 0):
        minn = res
        maxx = res
    else:
        minn = res
        maxx = res + 2
    return [minn, maxx]
    
n = int(input())
sol = solve(n)
print(str(sol[0])+" "+str(sol[1]))

n = int(input())
c1 = (n//7)*2
c2 = c1
k1 = n%7
k2 = k1-5
if k1 >= 2:
    c1 += 2
else:
    c1 +=k1
if k2 >= 0:
    c2 += k2
print(c2,c1)


n = int(input())

a = n // 7 * 2
b = a + min(n % 7, 2)
if n % 7 == 6:
    a += 1

print('{} {}'.format(a, b))


n = int(input())
if n == 1:
    print('0 1')
elif n == 2:
    print('0 2')
else:
    d = n - 5
    minDay = ((d // 7) * 2) + (2 if d % 7 >= 2 else d % 7)
    maxDay = ((n // 7) * 2) + (2 if n % 7 >= 2 else n % 7)
    print('%d %d' % (minDay, maxDay))