x = int(eval(input()))

n = -(-x//11)

print((2*n-1 if 0<x%11<7 else 2*n))
x = int(eval(input()))-1

d,m = divmod(x,11)

ans = d*2 + 1 + int(m>=6)

print(ans)

x = int(eval(input()))
n = -(-x // 11)
print((2 * n - 1 if 0 < x % 11 < 7 else 2 * n))

x = int(eval(input())) - 1
d, m = divmod(x, 11)
ans = d * 2 + 1 + int(m >= 6)
print(ans)

-x = int(eval(input())) -n = -(-x // 11) -print((2 * n - 1 if 0 < x % 11 < 7 else 2 * n)) +x = int(eval(input())) - 1 +d, m = divmod(x, 11) +ans = d * 2 + 1 + int(m >= 6) +print(ans)