Nikolay has a lemons, b apples and c pears. He decided to cook a compote. According to the recipe the fruits should be in the ratio 1: 2: 4. It means that for each lemon in the compote should be exactly 2 apples and exactly 4 pears. You can't crumble up, break up or cut these fruits into pieces. These fruits — lemons, apples and pears — should be put in the compote as whole fruits.

Your task is to determine the maximum total number of lemons, apples and pears from which Nikolay can cook the compote. It is possible that Nikolay can't use any fruits, in this case print 0. 


-----Input-----

The first line contains the positive integer a (1 ≤ a ≤ 1000) — the number of lemons Nikolay has. 

The second line contains the positive integer b (1 ≤ b ≤ 1000) — the number of apples Nikolay has. 

The third line contains the positive integer c (1 ≤ c ≤ 1000) — the number of pears Nikolay has.


-----Output-----

Print the maximum total number of lemons, apples and pears from which Nikolay can cook the compote.


-----Examples-----
Input
2
5
7

Output
7

Input
4
7
13

Output
21

Input
2
3
2

Output
0



-----Note-----

In the first example Nikolay can use 1 lemon, 2 apples and 4 pears, so the answer is 1 + 2 + 4 = 7.

In the second example Nikolay can use 3 lemons, 6 apples and 12 pears, so the answer is 3 + 6 + 12 = 21.

In the third example Nikolay don't have enough pears to cook any compote, so the answer is 0.

Difficulty: interview

Starter code:

Solutions:
n1 = int( input() )
n2 = int( input() )
n3 = int( input() )
print( min( n1 , n2 // 2 , n3 // 4 ) * 7 )


#!/usr/bin/env python3

def main():
    try:
        while True:
            a = int(input())
            b = int(input())
            c = int(input())
            x = min(a, b >> 1, c >> 2)
            print(x * 7)

    except EOFError:
        pass

main()


a = int(input())
b = int(input())
c = int(input())
print(7 * min(a, b // 2, c // 4))

a = int(input())
b = int(input())
c = int(input())

m_a = a
m_b = b // 2
m_c = c // 4
print(min(m_a, m_b, m_c) * 7)



a = int(input())
b = int(input())
c = int(input())

ans = 0
for x in range(a + 1):
    if (x * 2 > b or x * 4 > c):
        continue
    ans = max(ans, x + 2 * x + 4 * x)
print(ans)


a, b, c = int(input()), int(input()), int(input())
print(min(a, b // 2, c // 4) * 7)

a,b,c=[int(input()) for i in range(3)]
print(min(a,b//2,c//4)*7)


a = int(input())
b = int(input())//2
c = int(input())//4
print(7*min(a,min(b,c)))

import sys

a = int(sys.stdin.readline())
b = int(sys.stdin.readline())
c = int(sys.stdin.readline())

res = min([a, b // 2, c // 4])
print(7 * res)




a = int(input())
b = int(input())
c = int(input())
print(min(a, b//2, c//4) * 7)


a = int(input())
b = int(input())
c = int(input())
per = min(a,b//2,c//4)
print(per*7)

#CF1
a=int(input())
b=int(input())
c=int(input())
#l=list(map(int,input()))
n=min([a//1,b//2,c//4])
print(7*n)


a = int(input())
b = int(input())
c = int(input())

print(min(a, b//2, c//4)*7)


a = int(input())
b = int(input())//2
c = int(input())//4
mn = min([a, b, c]) * 7
print(mn)

a = int(input())
b = int(input())
c = int(input())

n = 0
while n + 1 <= a and (n + 1) * 2 <= b and (n + 1) * 4 <= c:
    n += 1

print(7 * n)

a = int(input())
b = int(input())//2
c = int(input())//4
print(min([a,b,c])*7)


a = int(input())
b = int(input())
c = int(input())

ans = 0
for i in range(a + 1):
    if b >= i * 2 and c >= i * 4:
        ans = i * 7
print(ans)

a = int(input())
b = int(input())
c = int(input())
ans = 0

while (a - 1 >= 0 and b - 2 >= 0 and c - 4 >= 0):
    a -= 1
    b -= 2
    c -= 4
    ans += 7

print(ans)

a = int(input())
b = int(input())
c = int(input())
ans = 0
while a > 0 and b > 1 and c > 3:
    a -= 1
    b -= 2
    c -= 4
    ans += 7
print(ans)

A = int(input())
B = int(input())
C = int(input())

sol = 0
for a in range(1, A+1):
    if B >= a*2 and C >= a*4:
        sol = max(sol, 7*a)

print(sol)


a,b,c = int(input()),int(input()),int(input())

t = min(a, b//2, c//4)

print(t + t*2 + t*4)


a = int(input())
b = int(input())
c = int(input())
for i in range(1, 1000):
    if i <= a and i * 2 <= b and i * 4 <= c:
        continue
    else:
        break
print(i - 1 + (i - 1) * 2 + (i - 1) * 4)

l = int(input())
y = int(input())
g = int(input())
cnt = 0
while l >= 1 and y>=2 and g >=4:
    cnt+=7
    l-=1
    y-=2
    g-=4
print(cnt)

#!/usr/bin/env python3
# -*- coding: utf-8 -*-

# n = int(iunput())
#
# a, b = [int(i) for i in input().split()]
#

a = int(input())
b = int(input())
c = int(input())
max_b = b//2
max_c = c//4
doli = min(a, max_b, max_c)
kompot = doli *7
print (kompot)

		
	



a = int(input())
b = int(input())
c = int(input())
res = 0
while a - 1 >= 0 and b - 2 >= 0 and c - 4 >= 0:
    a -= 1
    b -= 2
    c -= 4
    res += 7
print(res)