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: EASY
Tags: Mathematics

Implementation

Starter code:

Solutions:
a = int(input())
b = int(input())
c = int(input())
n = b // 2
n1 = c // 4
t = min(a, n)
t = min(t, n1)
print(t * 7)


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, queue, copy
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return [int(x) for x in sys.stdin.readline().split()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def I():
	return int(sys.stdin.readline())

def LS():
	return sys.stdin.readline().split()

def S():
	return input()

def main():
	a = I()
	b = I()
	c = I()
	for i in range(a + 1)[::-1]:
		if i * 2 <= b and i * 4 <= c:
			return 7 * i
	return 0
print(main())


import sys
input = sys.stdin.readlines()
lemons = int(input[0])
apples = int(input[1])
pears = int(input[2])
for lemon_num in range(lemons, 0, -1):
	case_apples = lemon_num * 2
	case_pears = lemon_num * 4
	if case_apples <= apples and case_pears <= pears:
		print(lemon_num + case_pears + case_apples)
		break
else:
	print('0')


x = int(input())
y = int(input())
z = int(input())
temp = 0
while temp == 0:
	if y >= 2 * x and z >= 4 * x:
		print(7 * x)
		temp = 1
	elif y < 2 * x:
		x -= 1
	elif z < 4 * x:
		x -= 1


f = lambda : map(int, input().split())
a = int(input())
b = int(input())
c = int(input())
(i, j, k) = (1, 2, 4)
while i <= a and j <= b and (k <= c):
	i += 1
	j += 2
	k += 4
print(max(0, i + j + k - 7))


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


def A7(n, x, y):
	(X, Y) = (0, 0)
	while n > 0:
		if X + 2 > x or Y + 4 > y:
			break
		n -= 1
		X += 2
		Y += 4
	if X > 0 and Y > 0:
		return X + Y + X // 2
	else:
		return 0
n = int(input())
x = int(input())
y = int(input())
print(A7(n, x, y))


import sys
import math
get_string = lambda : sys.stdin.readline().strip()
get_list = lambda : list(map(int, sys.stdin.readline().strip().split()))
get_intList_from_str = lambda : list(map(int, list(sys.stdin.readline().strip())))
get_charList_from_str = lambda : list(sys.stdin.readline().strip())
get_int = lambda : int(sys.stdin.readline().strip())
pt = lambda x: sys.stdout.write(str(x))
a = get_int()
b = get_int()
c = get_int()
m = min(a, b // 2, c // 4)
print(m + 2 * m + 4 * m)


a = int(input())
b = int(input())
c = int(input())
tmp = 0
tmp2 = min(a // 1, b // 2, c // 4)
for i in (1, 2, 4):
	tmp += tmp2 * i
print(tmp)


a = int(input())
b = int(input())
c = int(input())
s = min(a, min(int(b / 2), int(c / 4)))
print(1 * s + 2 * s + 4 * s)


l = int(input())
a = int(input())
p = int(input())
x = min(l, a // 2, p // 4)
print(x * 7)


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


a = int(input())
b = int(input())
c = int(input())
i = 0
while True:
	a -= 1
	b -= 2
	c -= 4
	if a < 0 or b < 0 or c < 0:
		break
	else:
		i += 1
print(i * 7)


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


a = int(input())
b = int(input())
c = int(input())
i = a
test = False
while i != 0 and test == False:
	if b >= 2 * i and c >= 4 * i:
		m = i + 2 * i + 4 * i
		test = True
	else:
		i = i - 1
if i == 0:
	print(0)
else:
	print(m)


import sys
import re
dict = {}
i = 0
for j in range(3):
	temp = input()
	temp = temp.strip()
	if temp != '':
		dict[i] = int(temp)
		i += 1
finished = 0
lim = dict[0]
while lim != 0:
	if dict[1] >= 2 * lim and dict[2] >= 4 * lim:
		print(lim + 2 * lim + 4 * lim)
		finished = 1
		break
	lim -= 1
if finished == 0:
	print(0)


l = int(input())
a = int(input())
c = int(input())
s = 0
while 0 < l >= 1 and 0 < a >= 2 and (0 < c >= 4):
	l -= 1
	a -= 2
	c -= 4
	s += 1 + 2 + 4
print(s)


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


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


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


from sys import stdin, stdout

def main():
	a = int(stdin.readline())
	b = int(stdin.readline())
	c = int(stdin.readline())
	b1 = b // 2
	c1 = c // 4
	aa = min(a, b1, c1)
	stdout.write(str(aa + aa * 2 + aa * 4))
main()


a = int(input())
b = int(input())
c = int(input())
x = a
y = b // 2
z = c // 4
s = [x, y, z]
s.sort()
sss = 6
print(s[0] * 7)


lemons = int(input())
apples = int(input()) // 2
pears = int(input()) // 4
total_sum = min(lemons, apples, pears) * 7
if apples * 2 < 2 or pears * 4 < 4:
	print(0)
else:
	print(total_sum)


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


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


l = int(input())
m = int(input())
n = int(input())
r = [1, 2, 4]
minc = l // r[0]
if m // r[1] < minc:
	minc = m // r[1]
if n // r[2] < minc:
	minc = n // r[2]
if minc == 0:
	print('0')
else:
	minc = 1 * minc + 2 * minc + 4 * minc
	print(minc)


a = int(input())
b = int(input())
c = int(input())
x = a // 1
y = b // 2
z = c // 4
if x < y:
	if z < x:
		n = z
	else:
		n = x
elif z < y:
	n = z
else:
	n = y
total = 7 * n
print(total)


a = int(input())
b = int(input())
c = int(input())
l = []
l.append(a)
l.append(b // 2)
l.append(c // 4)
r = min(l)
print(r * 7)


a = int(input())
b = int(input())
c = int(input())
i = 0
p = 0
for i in range(a + 1):
	if 2 * i <= b and 4 * i <= c:
		p = i
if p > 0:
	sum = p + 2 * p + 4 * p
else:
	sum = 0
print(sum)


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


import math
a = int(input())
b = int(input())
c = int(input())
res = 0
for i in range(0, a + 1):
	t1 = i
	t2 = 2 * i
	t3 = 4 * i
	if b >= t2 and c >= t3:
		res = max(t1 + t2 + t3, res)
print(res)


def int_lst_input():
	return [int(val) for val in input().split(' ')]

def int_input():
	return int(input())

def print_lst(lst):
	print(' '.join([str(val) for val in lst]))

def solve():
	a = int_input()
	b = int_input()
	c = int_input()
	comp = 0
	while a > 0 and b > 1 and (c > 3):
		comp += 1
		a -= 1
		b -= 2
		c -= 4
	print(comp * 7)
solve()


lemon = int(input())
apples = int(input())
pears = int(input())
print(7 * min(lemon // 1, apples // 2, pears // 4))


a = int(input())
b = int(input())
c = int(input())
while 4 * a > c:
	a -= 1
c = 4 * a
while 2 * a > b:
	a -= 1
b = 2 * a
c = a * 4
print(a + b + c)


a = int(input())
b = int(input())
c = int(input())
cc = c // 4
bb = b // 2
print(min(cc, bb, a) + 2 * min(a, bb, cc) + 4 * min(a, bb, cc))


def min(x, y):
	if x < y:
		return x
	else:
		return y
a = int(input())
b = int(input())
c = int(input())
print(7 * min(a, min(b // 2, c // 4)))


def R():
	return map(int, input().split())

def I():
	return int(input())

def S():
	return str(input())

def L():
	return list(R())
from collections import Counter
import math
import sys
from itertools import permutations
import bisect
a = I()
b = I()
c = I()
for x in range(10000):
	if not (x <= a and 2 * x <= b and (4 * x <= c)):
		break
print(7 * (x - 1))


a = int(input())
b = int(input())
c = int(input())
x = []
x.append(a // 1)
x.append(b // 2)
x.append(c // 4)
print(min(x) * 7)


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


a = int(input())
b = int(input())
c = int(input())
b //= 2
c //= 4
l = [a, b, c]
ans = 0
if b >= 1 and c >= 1:
	ans = min(l) * 7
print(ans)


a = int(input())
b = int(input())
c = int(input())
sum = 0
while c >= 4:
	if b >= 2:
		if a >= 1:
			sum += 7
			c -= 4
			b -= 2
			a -= 1
		else:
			break
	else:
		break
print(sum)


def number(a, b, c):
	counter = 0
	(a, b, c) = (a - 1, b - 2, c - 4)
	while a >= 0 and b >= 0 and (c >= 0):
		a -= 1
		b -= 2
		c -= 4
		counter += 1
	return counter * 7
(a, b, c) = (int(input()), int(input()), int(input()))
print(number(a, b, c))


l = int(input())
a = int(input())
p = int(input())
for i in range(l, -1, -1):
	if a >= 2 * i and p >= 4 * i:
		print(7 * i)
		break


a = int(input())
b = int(input())
c = int(input())
lemons = 0
for i in range(1, a + 1):
	if b >= 2 * i and c >= 4 * i:
		lemons = i
	else:
		break
print(lemons * 7)


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


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


a = int(input())
b = int(input())
c = int(input())
t = True
while t:
	if b >= a * 2 and c >= a * 4:
		print(a + a * 2 + a * 4)
		t = False
	else:
		a = a - 1


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


l = int(input())
a = int(input())
p = int(input())
rl = l
la = a // 2
lp = p // 4
min = min([rl, la, lp])
print(min + min * 2 + min * 4)


z = input
import math
a = int(z())
b = int(z())
c = int(z())
s = 0
v = 0
for i in range(a, 0, -1):
	if i * 2 <= b and i * 4 <= c:
		print(i + i * 2 + i * 4)
		v = 1
		break
if v == 0:
	print(0)


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


a = int(input())
b = int(input())
c = int(input())
res = 1 << 31
res = min(res, c // 4)
res = min(res, b // 2)
res = min(res, a)
res = res + res * 2 + res * 4
print(res)


lemons = int(input().strip('\n'))
apples = int(input().strip('\n'))
pears = int(input().strip('\n'))
nb = [lemons, apples // 2, pears // 4]
total = min(nb) + min(nb) * 2 + min(nb) * 4
print(total)


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


import fileinput
num_args = 3
for arg in range(num_args):
	if arg == 0:
		a = int(input())
	elif arg == 1:
		b = int(input())
	else:
		c = int(input())
max_fruit = 0
if b // 2 >= a and c // 4 >= a:
	max_fruit += a + a * 2 + a * 4
else:
	for i in range(1, int(a)):
		if b // i >= 2 and c // i >= 4:
			max_fruit += 7
print(max_fruit)


a = int(input())
b = int(input())
c = int(input())
x = a
ans = 0
while x != 0:
	if b >= 2 * x and c >= 4 * x:
		ans = 7 * x
		break
	else:
		x -= 1
print(ans)


l = int(input())
a = int(input())
p = int(input())
chars = []
if l >= 1 and a >= 2 and (p >= 4):
	l2 = l / 1
	a2 = a / 2
	p2 = p / 4
	chars.append(int(l2))
	chars.append(int(a2))
	chars.append(int(p2))
	d = min(chars)
	print(d + d * 2 + d * 4)
else:
	print(0)


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


a = int(input())
b = int(input())
c = int(input())
mins = a
if mins > b / 2:
	mins = b / 2
if mins > c / 4:
	mins = c / 4
print(7 * int(mins))


a = int(input())
b = int(input())
c = int(input())
per = 7
a_N = a // 1
b_N = b // 2
c_N = c // 4
N = min(a_N, b_N, c_N)
print(N * 7)


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


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


a = int(input())
b = int(input())
c = int(input())
for i in range(a, -1, -1):
	if i * 2 <= b and i * 4 <= c:
		print(i * 7)
		exit(0)


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())
pr = min(a // 1, b // 2, c // 4)
print(pr * 1 + pr * 2 + pr * 4)


x = int(input())
y = int(input())
z = int(input())
A = min(x, y // 2, z // 4)
print(A * 7)


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


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


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


a = int(input())
b = int(input())
c = int(input())
m = [a, int(b / 2), int(c / 4)]
mini = min(m)
if mini == 0:
	print(0)
else:
	print(sum([mini, mini * 2, mini * 4]))


x = int(input())
y = int(input())
z = int(input())
s = 0
s = min(x, min(y // 2, z // 4))
print(s * 1 + s * 2 + s * 4)


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


import math
a = int(input())
b = int(input())
c = int(input())
p = b // 2
h = c // 4
k = min(a, p, h) * 7
print(k)


q = int(input())
w = int(input())
e = int(input())
w //= 2
e //= 4
print(7 * min(q, w, e))


print(min(int(input()), min(int(input()) // 2, int(input()) // 4)) * 7)


I = lambda : int(input())
a = [I() / 1, I() / 2, I() / 4]
a = list(map(int, a))
print(min([a[0], a[1], a[2]]) * 7)


import math
import pprint
lemons = int(input())
apples = int(input())
pears = int(input())
fruits = 0
for i in range(1, lemons + 1):
	if apples // (2 * i) and pears // (4 * i):
		fruits = max(fruits, i + 2 * i + 4 * i)
print(fruits)


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


a = int(input())
y = int(input())
z = int(input())
while True:
	if a * 2 <= y and a * 4 <= z:
		print(a + a * 2 + a * 4)
		quit()
	a = a - 1


a = int(input())
b = int(input())
c = int(input())
i = j = k = 0
while i <= a and j <= b and (k <= c):
	i += 1
	j += 2
	k += 4
if i == 0:
	print(0)
else:
	print(i - 1 + j - 2 + k - 4)


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


lemons = int(input())
apples = int(input())
pears = int(input())
out = min(lemons, apples // 2, pears // 4) * 7
print('{}'.format(out))


def ii():
	return int(input())

def fi():
	return float(input())

def si():
	return input()

def mi():
	return map(int, input().split())

def li():
	return list(mi())
a = ii()
b = ii()
c = ii()
b //= 2
c //= 4
print(7 * min(a, b, c))


a = int(input())
b = int(input())
c = int(input())
if c < 4 or b < 2:
	print(0)
	exit(0)
(x, y, z, s) = (1, 2, 4, 0)
while x <= a and y <= b and (z <= c):
	s = x + y + z
	x += 1
	y = x * 2
	z = x * 4
print(s)


lemons = int(input())
apples = int(input())
pears = int(input())
print(min(lemons, apples // 2, pears // 4) * 7)


a = int(input())
b = int(input()) // 2
x = int(input()) // 4
if x <= 0:
	print('0')
elif b <= 0:
	print('0')
elif a <= 0:
	print('0')
else:
	print(min(a, b, x) + 2 * min(a, b, x) + 4 * min(a, b, x))


a = int(input())
b = int(input())
c = int(input())
for i in range(max(a, b, c)):
	if i * 1 <= a and i * 2 <= b and (i * 4 <= c):
		z = i * 1 + i * 2 + i * 4
print(z)


a = int(input())
b = int(input())
c = int(input())
x = a // 1
y = b // 2
z = c // 4
d = min(x, y, z)
res = d * 1 + d * 2 + d * 4
print(res)


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


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


import math
lemon = int(input())
apple = int(input())
pear = int(input())
count = 0
n = lemon
for i in range(n):
	if lemon - 1 >= 0:
		if apple - 2 >= 0:
			if pear - 4 >= 0:
				lemon = lemon - 1
				apple = apple - 2
				pear = pear - 4
				count = count + 1
print('{}'.format(7 * count))


x = int(input())
y = int(input())
z = int(input())
t = min(x, y // 2, z // 4)
print(t * 7)


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


import sys
_input = sys.stdin.readlines()
_input = [int(val.strip()) for val in _input]
a = _input[0]
b = _input[1] // 2
c = _input[2] // 4
num = min(a, b, c)
print(7 * num)


a = int(input())
b = int(input())
c = int(input())
ans = 0
while a != 0:
	if b < 2 or c < 4:
		break
	else:
		ans += 7
		a = a - 1
		b = b - 2
		c = c - 4
print(ans)


from sys import stdin, stdout
a = int(stdin.readline())
b = int(stdin.readline())
c = int(stdin.readline())
c //= 4
b //= 2
stdout.write(str(7 * min(min(a, b), c)))


import math

def solve(a, b, c):
	count = 0
	for i in range(a):
		if b >= 2 and c >= 4:
			count += 7
			b -= 2
			c -= 4
	return count

def main():
	a = int(input())
	b = int(input())
	c = int(input())
	print(solve(a, b, c))
main()


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


a = int(input())
b = int(input())
c = int(input())
sum1 = 0
for _ in range(a, 0, -1):
	if 2 * _ <= b and 4 * _ <= c:
		sum1 = _ + 2 * _ + 4 * _
		print(sum1)
		break
if sum1 == 0:
	print(0)


l = []
for i in range(3):
	n = int(input())
	l.append(n)
ans = min(l[0], l[1] // 2, l[2] // 4) * 7
print(ans)


from __future__ import division, print_function
from sys import stdin, stdout
import itertools, os, sys, threading
from collections import deque, Counter, OrderedDict, defaultdict
import heapq
from math import ceil, floor, log, sqrt, factorial, pow, pi, gcd
from fractions import Fraction

def ii():
	return int(input())

def si():
	return str(input())

def mi():
	return map(int, input().split())

def li():
	return list(mi())

def fii():
	return int(stdin.readline())

def fsi():
	return str(stdin.readline())

def fmi():
	return map(int, stdin.readline().split())

def fli():
	return list(fmi())
abc = 'abcdefghijklmnopqrstuvwxyz'
abd = {'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12, 'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24, 'z': 25}
mod = 1000000007
(dx, dy) = ([-1, 1, 0, 0], [0, 0, 1, -1])

def getKey(item):
	return item[0]

def sort2(l):
	return sorted(l, key=getKey)

def d2(n, m, num):
	return [[num for x in range(m)] for y in range(n)]

def isPowerOfTwo(x):
	return x and (not x & x - 1)

def decimalToBinary(n):
	return bin(n).replace('0b', '')

def ntl(n):
	return [int(i) for i in str(n)]

def powerMod(x, y, p):
	res = 1
	x %= p
	while y > 0:
		if y & 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x
graph = defaultdict(list)
visited = [0] * 1000000
col = [-1] * 1000000

def dfs(v, c):
	if visited[v]:
		if col[v] != c:
			print('-1')
			exit()
		return
	col[v] = c
	visited[v] = 1
	for i in graph[v]:
		dfs(i, c ^ 1)

def bfs(d, v):
	q = []
	q.append(v)
	visited[v] = 1
	while len(q) != 0:
		x = q[0]
		q.pop(0)
		for i in d[x]:
			if visited[i] != 1:
				visited[i] = 1
				q.append(i)
		print(x)

def make_graph(e):
	d = {}
	for i in range(e):
		(x, y) = mi()
		if x not in d.keys():
			d[x] = [y]
		else:
			d[x].append(y)
		if y not in d.keys():
			d[y] = [x]
		else:
			d[y].append(x)
	return d

def gr2(n):
	d = {}
	for i in range(n):
		(x, y) = mi()
		if x not in d.keys():
			d[x] = [y]
		else:
			d[x].append(y)
	return d

def connected_components(graph):
	seen = set()

	def dfs(v):
		vs = set([v])
		component = []
		while vs:
			v = vs.pop()
			seen.add(v)
			vs |= set(graph[v]) - seen
			component.append(v)
		return component
	ans = []
	for v in graph:
		if v not in seen:
			d = dfs(v)
			ans.append(d)
	return ans

def primeFactors(n):
	s = set()
	while n % 2 == 0:
		s.add(2)
		n = n // 2
	for i in range(3, int(sqrt(n)) + 1, 2):
		while n % i == 0:
			s.add(i)
			n = n // i
	if n > 2:
		s.add(n)
	return s

def find_all(a_str, sub):
	start = 0
	while True:
		start = a_str.find(sub, start)
		if start == -1:
			return
		yield start
		start += len(sub)
a = ii()
b = ii()
c = ii()
count = 0
while a > 0 and b > 1 and (c > 3):
	count += 7
	a -= 1
	b -= 2
	c -= 4
print(count)


n = int(input())
a = int(input())
b = int(input())
pears = b // 4
apples = a // 2
lemons = n // 1
c = min(pears, apples, lemons)
score = c * 1 + c * 2 + c * 4
print(score)


a = int(input())
b = int(input())
c = int(input())
t = 7
y = []
y.append(a)
y.append(b // 2)
y.append(c // 4)
print(min(y) * 7)


a = int(input())
p = a // 1
b = int(input())
q = b // 2
c = int(input())
r = c // 4
yo = min(p, q, r)
ans = 7 * yo
print(ans)


from sys import stdin
a = int(stdin.readline())
b = int(stdin.readline())
c = int(stdin.readline())
summa = 0
if a == 0 or b == 0 or c == 0:
	summa = 0
else:
	for x in range(1, a + 1):
		if b // 2 > 0 and c // 4 > 0:
			summa += 1
			summa += 2
			summa += 4
			a -= 1
			b -= 2
			c -= 4
	print(summa)


l = int(input())
a = int(input())
p = int(input())
flag = 0
c = 0
while l >= 1 and a >= 2 and (p >= 4):
	c += 1
	l = l - 1
	a = a - 2
	p = p - 4
	flag = 1
if flag == 0:
	print(0)
else:
	print(c * 7)


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


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


T = input
print(int(min(int(T()) / 1, int(T()) / 2, int(T()) / 4)) * 7)


import sys

def check(a, b, c):
	x = min(a, b // 2, c // 4)
	return x + x * 2 + x * 4

def main():
	a = int(sys.stdin.readline())
	b = int(sys.stdin.readline())
	c = int(sys.stdin.readline())
	print(check(a, b, c))
main()


def helper(line_one, line_two, line_three):
	temp = int(line_three / 4)
	if temp <= line_two / 2 and temp <= line_one:
		return temp
	temp1 = int(line_two / 2)
	if temp1 <= line_three / 4 and temp1 <= line_one:
		return temp1
	temp2 = int(line_one)
	if temp2 <= line_two / 2 and temp2 <= line_three / 4:
		return temp2
line_one = int(input())
line_two = int(input())
line_three = int(input())
if line_two < 2 and line_three < 4:
	print('0')
else:
	res = helper(line_one, line_two, line_three)
	print(res * 7)


from sys import stdin
a = int(stdin.readline().rstrip())
b = int(stdin.readline().rstrip())
c = int(stdin.readline().rstrip())
print(min(a, b // 2, c // 4) * 7)


a = int(input())
b = int(input())
c = int(input())
if a < 1 or b < 2 or c < 4:
	print(0)
	exit()
a //= 1
b //= 2
c //= 4
l = [a, b, c]
print(7 * min(l))


import sys, math, string
input = sys.stdin.readline
L = lambda : list(map(int, input().split()))
Ls = lambda : list(input().split().strip())
M = lambda : map(int, input().split())
print(min(int(input()), int(input()) // 2, int(input()) // 4) * 7)


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


a = int(input())
b = int(input())
c = int(input())
while a > -1:
	if a * 2 <= b and a * 4 <= c:
		print(a + a * 2 + a * 4)
		break
	a -= 1


import math
mas = []
a = int(input())
b = int(input())
c = int(input())
comp = 0
mas.append(math.floor(a / 1))
mas.append(math.floor(b / 2))
mas.append(math.floor(c / 4))
mas.sort()
comp = mas[0]
print(comp * 7)


import math
import itertools
import sys
from collections import *
from decimal import *
files = False
if files:
	name = 'cond'
	sys.stdout = open('%s.out' % name, mode='w')
	sys.stdin = open('%s.in' % name)
a = [int(i) for i in input().split()][0]
b = [int(i) for i in input().split()][0]
c = [int(i) for i in input().split()][0]
d = min(a, b // 2, c // 4)
print(d + d * 2 + d * 4)
sys.stdout.close()


i = int(input())
j = int(input())
k = int(input())
count = 0
while i >= 1 and j >= 2 and (k >= 4):
	i -= 1
	j -= 2
	k -= 4
	count += 1
if count > 0:
	print(7 * count)
else:
	print(0)


import bisect
a = int(input())
b = int(input())
c = int(input())
a1 = a // 1
b1 = b // 2
c1 = c // 4
print(7 * min(a1, b1, c1))


print(7 * min((int(input()) // 2 ** i for i in range(3))))


def main():
	nums = []
	for i in range(3):
		nums.append(int(input()))
	print(compote(nums[0], nums[1], nums[2]))

def compote(a, b, c):
	d = 0
	while a >= 1 and b >= 2 and (c >= 4):
		a -= 1
		b -= 2
		c -= 4
		d += 1
	return d * 7
main()


a = int(input())
b = int(input())
c = int(input())
a = a // 1
b = b // 2
c = c // 4
s = 0
if a < b and a < c:
	s = a * 7
if a <= b and a <= c:
	s = a * 7
if b < a and b < c:
	s = (b + 1) * 7
if b <= a and b <= c:
	s = b * 7
if c < a and c < b:
	s = c * 7
if c <= a and c <= b:
	s = c * 7
print(s)


a = int(input())
b = int(input())
c = int(input())
t = a
while t >= 0:
	flag = 0
	if t * 2 <= b:
		if t * 4 <= c:
			print(7 * t)
			break
		else:
			t -= 1
			flag = 1
	elif flag == 0:
		t -= 1


def main():
	a = int(input())
	b = int(input())
	c = int(input())
	k = min(a, b // 2, c // 4)
	print(k + 2 * k + 4 * k)
	return 0
main()


a = int(input())
b = int(input())
c = int(input())
i = 0
while i <= a:
	if 2 * i <= b and 4 * i <= c:
		i = i + 1
	else:
		break
print(7 * (i - 1))


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


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


(a, b, c) = [int(input()) for _ in ' ' * 3]
s = -7
while a >= 0 and b >= 0 and (c >= 0):
	(a, b, c, s) = (a - 1, b - 2, c - 4, s + 7)
print(s)


a = int(input())
b = int(input())
c = int(input())
b = b // 2
c = c // 4
if a < b and a < c:
	print(a * 7)
if b < a and b < c:
	print(b * 7)
if c < a and c < b:
	print(c * 7)
if c == a and b == a:
	print(a * 7)
if b == c and a > b:
	print(b * 7)
if b == a and c > a:
	print(a * 7)
if a == c and b > a:
	print(a * 7)


from math import sqrt
a = []
for _ in range(3):
	a.append(int(input()))
a[1] //= 2
a[2] //= 4
x = min(a)
print(7 * x)


l = int(input())
a = int(input())
p = int(input())
ll = l
aa = a // 2
pp = p // 4
print(min(ll, aa, pp) * 1 + min(ll, aa, pp) * 2 + min(ll, aa, pp) * 4)


a = int(input())
b = int(input())
c = int(input())
for i in range(0, a + 2):
	if i + 1 > a or 2 * (i + 1) > b or 4 * (i + 1) > c:
		print(7 * i)
		break


limoes = int(input())
macas = int(input())
peras = int(input())
m = 2 * limoes
p = 4 * limoes
resposta = 0
while limoes != 0 and macas >= 2 and (peras >= 4):
	resposta += 1 + 2 + 4
	limoes -= 1
	macas -= 2
	peras -= 4
print(resposta)


s1 = int(input())
s2 = int(input())
s3 = int(input())
p = 0
while s1 > 0 and s2 > 1 and (s3 > 3):
	s1 = s1 - 1
	s2 = s2 - 2
	s3 = s3 - 4
	p = p + 7
print(p)


n1 = int(input())
n2 = int(input())
n3 = int(input())
l = [n1, n2 // 2, n3 // 4]
print(min(l) * 7)


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


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


a = int(input())
b = int(input())
c = int(input())
while a > 0:
	if a * 2 <= b and a * 4 <= c:
		print(a + 2 * a + 4 * a)
		exit()
	a -= 1
print(0)


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


import sys
from math import sqrt, floor, factorial
from collections import deque, Counter
inp = sys.stdin.readline
read = lambda : list(map(int, inp().strip().split()))

def solve():
	mini = 1001
	arr = [1, 2, 4]
	for i in range(3):
		mini = min(mini, int(inp()) // arr[i])
	print(7 * mini)
solve()


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


a = int(input())
b = int(input())
c = int(input())
n = 1
while n <= a and 2 * n <= b and (4 * n <= c):
	n += 1
print(n * 7 - 7)


def recipe():
	lemons = int(input())
	apples = int(input())
	grapes = int(input())
	while True:
		if lemons * 2 <= apples and lemons * 4 <= grapes:
			print(lemons + lemons * 2 + lemons * 4)
			return
		lemons -= 1
		if lemons == 0:
			print(0)
			return
recipe()


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


n = int(input())
y = int(input())
r = int(input())
h = 0
for i in range(n):
	if n - 1 >= 0 and y - 2 >= 0 and (r - 4 >= 0):
		n -= 1
		y -= 2
		r -= 4
		h += 7
print(h)


import math
a = int(input())
b = int(input())
c = int(input())
d = []
k = int(math.floor(b / 2))
l = int(math.floor(c / 4))
d.append(a)
d.append(k)
d.append(l)
d.sort()
if d[0] == '0':
	print(0)
t = int(d[0])
ans = int(t * 1 + t * 2 + t * 4)
print(ans)


lemons = int(input())
apples = int(input())
pears = int(input())
compote = 0
while compote <= lemons and compote * 2 <= apples and (compote * 4 <= pears):
	compote += 1
compote -= 1
total = compote + 2 * compote + 4 * compote
print(total)


a = int(input())
b = int(input())
c = int(input())
flag = False
while a > 0:
	if a * 2 <= b and a * 4 <= c:
		b = a * 2
		c = a * 4
		flag = True
		break
	else:
		a -= 1
if flag:
	print(a + b + c)
else:
	print(0)


a = int(input())
b = int(input())
c = int(input())
s1 = a
s2 = b // 2
s3 = c // 4
m = min(s1, s2, s3)
print(1 * m + 2 * m + 4 * m)


a = int(input())
b = int(input())
c = int(input())
if a < 1 or b < 2 or c < 4:
	print('0')
else:
	x = c // 4
	y = x * 2
	z = x * 4
	if a < x:
		x = a
		y = x * 2
		z = x * 4
	if b < y:
		x = b // 2
		y = x * 2
		z = x * 4
	print(x + y + z)


def main():
	vals = [int(input()) for v in range(3)]
	d = min(vals[0], vals[1] // 2, vals[2] // 4)
	print(d + d * 2 + d * 4)
main()


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())
(x, y, z, a1, b1, c1) = (0, 0, 0, 0, 0, 0)
while a > x and b > y and (c > z):
	x += 1
	y = x * 2
	z = x * 4
	if a >= x and b >= y and (c >= z):
		(a1, b1, c1) = (x, y, z)
	else:
		break
print(a1 + b1 + c1)


x = int(input())
y = int(input())
z = int(input())
sum = 0
while True:
	if x >= 1 and y >= 2 and (z >= 4):
		sum += 7
		x -= 1
		y -= 2
		z -= 4
	else:
		break
print(sum)


a = int(input())
b = int(input())
c = int(input())
if c < 4 or b < 2:
	print('0')
else:
	m = min(a, b // 2, c // 4)
	print(m * 7)


a = int(input())
b = int(input())
c = int(input())
if a < 1 or b < 2 or c < 4:
	s = 0
else:
	i = 1
	while i <= a:
		if i * 1 <= a and i * 2 <= b and (i * 4 <= c):
			s = 7 * i
		i += 1
print(s)


a = int(input())
b = int(input())
c = int(input())
min_count = list()
min_count.append(a / 1)
min_count.append(b // 2)
min_count.append(c // 4)
count = int(min(min_count))
print(count * 7)


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


sum = 0
a = int(input())
b = int(input())
c = int(input())
i = a
while i:
	L = i
	A = 2 * i
	P = 4 * i
	if A <= b and P <= c:
		sum = L + P + A
		break
	else:
		i = i - 1
if sum == 0:
	print(sum)
else:
	print(sum)


a = int(input())
b = int(input())
c = int(input())
b1 = b - b % 2
c1 = c - c % 4
m = 0
if a * 2 <= b and a * 4 <= c:
	m = 7 * a
if b1 // 2 <= a and b1 * 2 <= c:
	m = max(m, b1 + b1 // 2 + b1 * 2)
if c1 // 4 <= a and c1 // 2 <= b:
	m = max(m, c1 + c1 // 2 + c1 // 4)
print(m)


a = int(input())
b = int(input()) // 2
c = int(input()) // 4
print(min(a, b, c) * 7 if a > 0 and b > 0 and (c > 0) else 0)


a = int(input())
b = int(input())
c = int(input())
if 4 * a < 2 * b:
	min = 4 * a
	d = a
else:
	min = 2 * b
	d = b // 2
if c < min:
	min = c
	d = c // 4
k = d + 2 * d + 4 * d
print(k)


a = int(input())
b = int(input())
c = int(input())
max_a = min([b // 2, c // 4])
if max_a <= a:
	print(7 * max_a)
else:
	print(7 * a)


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


R = lambda : int(input())
lemon = R()
apple = R()
pears = R()
print(7 * min(lemon, apple // 2, pears // 4))


a = int(input())
b = int(input())
c = int(input())
ct = 0
while a:
	if b >= a * 2 and c >= a * 4:
		ct += 1
		print(a + a * 2 + a * 4)
		break
	a -= 1
if not ct:
	print(0)


l = eval(input())
a = eval(input())
p = eval(input())
x = min(l // 1, a // 2, p // 4)
print(x + x * 2 + x * 4)


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


lemon = int(input())
apple = int(input())
pear = int(input())
fruits = 0
if lemon < 1 or apple < 2 or pear < 4:
	print(0)
	exit()
else:
	for i in range(lemon):
		if lemon >= 1 and apple >= 2 and (pear >= 4):
			lemon -= 1
			apple -= 2
			pear -= 4
			fruits += 1
			fruits += 2
			fruits += 4
print(fruits)


def solve(a, b, c):
	s = 0
	for i in range(a + 1):
		if b < i * 2 or c < i * 4:
			break
		else:
			s = i
	return s

def main():
	a = int(input())
	b = int(input())
	c = int(input())
	s = solve(a, b, c)
	print(s + s * 2 + s * 4)
main()


import sys
import math
import random
input = sys.stdin.readline

def inp():
	return int(input())

def inara():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())
a = inp()
b = inp()
c = inp()
ans = 0
for i in range(1, a + 1):
	if b >= 2 * i and c >= 4 * i:
		ans = max(ans, i + 2 * i + 4 * i)
print(ans)


a = int(input())
b = int(input())
c = int(input())
if a < 1 or b < 2 or c < 4:
	print('0')
else:
	x = 1
	while a >= x and b >= 2 * x and (c >= 4 * x):
		x += 1
	print(7 * (x - 1))


a = []
for _ in range(3):
	a.append(int(input()))
print(7 * min((a[i] // 2 ** i for i in range(3))))


n = int(input())
m = int(input())
k = int(input())
print(7 * min(n, m // 2, k // 4))


import sys
a = int(input())
b = int(input())
c = int(input())
if a + b + c < 7 or (b < 2 and c < 4):
	print(0)
	sys.exit()
while a * 2 > b:
	a -= 1
while a * 4 > c:
	a -= 1
sys.stdout.write(str(a + 2 * a + 4 * a) + '\n')


a = int(input())
b = int(input())
c = int(input())
d = min(a, b // 2, c // 4)
if b < 2 or c < 4:
	print(0)
else:
	print(d + d * 2 + d * 4)


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


a = int(input())
b = int(input())
c = int(input())
d = c // 4
sums = 0
e = b // 2
h = a // 1
f = min(min(d, e), h)
sums = f * 1 + f * 2 + f * 4
print(sums)


t = 1
for _ in range(t):
	a = int(input())
	b = int(input())
	c = int(input())
	b //= 2
	c //= 4
	k = min(a, b, c)
	print(7 * k)


a = int(input())
b = int(input())
c = int(input())
while a > 0:
	if b >= a * 2:
		if c >= 4 * a:
			value = 7 * a
			print(value)
			break
		else:
			pass
	else:
		pass
	a = a - 1
if a == 0:
	print(0)


inps = [int(input()) for _ in range(3)]
max_val = 0
done = False
a = inps[0]
while a >= 1:
	if a * 2 <= inps[1] and a * 4 <= inps[2]:
		max_val += a + a * 2 + a * 4
		break
	else:
		a -= 1
print(max_val)


a = int(input())
b = int(input())
c = int(input())
if b >= 2 * a and c >= 4 * a:
	print(a + 2 * a + 4 * a)
else:
	while b < 2 * a or c < 4 * a:
		a = a - 1
	print(a + 2 * a + 4 * a)


a = int(input())
b = int(input())
c = int(input())
l = []
for i in range(1, a + 1):
	d = i
	e = 2 * i
	if e <= b:
		f = 2 * e
		if f <= c:
			x = d + e + f
			l.append(x)
if len(l) == 0:
	print(0)
else:
	print(max(l))


import sys
from sys import stdin, stdout
import bisect
import math
import heapq

def modinv(n, p):
	return pow(n, p - 2, p)

def cin():
	return map(int, sin().split())

def ain():
	return list(map(int, sin().split()))

def sin():
	return input()

def inin():
	return int(input())
import math

def Divisors(n):
	l = []
	for i in range(1, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n // i == i:
				l.append(i)
			else:
				l.append(i)
				l.append(n // i)
	return l

def most_frequent(list):
	return max(set(list), key=list.count)

def GCD(x, y):
	while y:
		(x, y) = (y, x % y)
	return x

def main():
	a = inin()
	b = inin()
	c = inin()
	temp = 0
	temp = c // 4
	if a < 1 or b < 2 or c < 4:
		print('0')
	elif a == 1 or b == 2 or c == 4:
		print('7')
	elif a >= int(c / 4) and b >= int(c / 2):
		print(7 * temp)
	else:
		print(7 * min(a, int(b / 2)))
py2 = round(0.5)
if py2:
	from future_builtins import ascii, filter, hex, map, oct, zip
	range = xrange
import os, sys
from io import IOBase, BytesIO
BUFSIZE = 8192

class FastIO(BytesIO):
	newlines = 0

	def __init__(self, file):
		self._file = file
		self._fd = file.fileno()
		self.writable = 'x' in file.mode or 'w' in file.mode
		self.write = super(FastIO, self).write if self.writable else None

	def _fill(self):
		s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
		self.seek((self.tell(), self.seek(0, 2), super(FastIO, self).write(s))[0])
		return s

	def read(self):
		while self._fill():
			pass
		return super(FastIO, self).read()

	def readline(self):
		while self.newlines == 0:
			s = self._fill()
			self.newlines = s.count(b'\n') + (not s)
		self.newlines -= 1
		return super(FastIO, self).readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.getvalue())
			(self.truncate(0), self.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		if py2:
			self.write = self.buffer.write
			self.read = self.buffer.read
			self.readline = self.buffer.readline
		else:
			self.write = lambda s: self.buffer.write(s.encode('ascii'))
			self.read = lambda : self.buffer.read().decode('ascii')
			self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
import sys

class ostream:

	def __lshift__(self, a):
		sys.stdout.write(str(a))
		return self
cout = ostream()
endl = '\n'

def readnumbers(zero=0):
	conv = ord if py2 else lambda x: x
	A = []
	numb = zero
	sign = 1
	i = 0
	s = sys.stdin.buffer.read()
	try:
		while True:
			if s[i] >= b'0'[0]:
				numb = 10 * numb + conv(s[i]) - 48
			elif s[i] == b'-'[0]:
				sign = -1
			elif s[i] != b'\r'[0]:
				A.append(sign * numb)
				numb = zero
				sign = 1
			i += 1
	except:
		pass
	if s and s[-1] >= b'0'[0]:
		A.append(sign * numb)
	return A
main()


l = int(input())
a = int(input())
p = int(input())
m = min(l, a // 2, p // 4)
print(sum([m, m * 2, m * 4]))


from __future__ import division
a = int(input())
b = int(input())
c = int(input())
val = min(a, b // 2, c // 4)
print(7 * val)


def compote(lemons, apples, pears):
	n = min(lemons, apples // 2, pears // 4)
	return 7 * n
lemons = int(input())
apples = int(input())
pears = int(input())
print(compote(lemons, apples, pears))


a = int(input())
b = int(input())
c = int(input())
f = 0
if b < 2 or c < 4:
	f = 1
ans = min(a, min(b // 2, c // 4))
if f == 0:
	print(7 * ans)
else:
	print(0)


a = int(input())
b = int(input())
c = int(input())
res2 = b // 2
res3 = c // 4
res1 = min(a, min(res2, res3))
ans = res1 + 2 * res1 + 4 * res1
print(ans)


a = int(input())
b = int(input())
c = int(input())
da = int(a / 1)
db = int(b / 2)
dc = int(c / 4)
min = min([da, db, dc])
print(min * 1 + min * 2 + min * 4)


l = int(input())
a = int(input())
p = int(input())
x = int(a // 2)
y = int(p // 4)
fl = min(x, y, l)
fa = fl * 2
fp = fl * 4
s = fl + fa + fp
print(s)


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

def solve(a, b, c):
	for i in range(min(a, b, c), 0, -1):
		if i <= a and i * 2 <= b and (i * 4 <= c):
			return i * 7
	return 0
print(solve(a, b, c))


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

def check_compote(a, b, c):
	while a > 0:
		if b >= 2 * a and c >= 4 * a:
			return 7 * a
		else:
			a -= 1
	return 0
print(check_compote(a, b, c))


a = int(input())
b = int(input())
c = int(input())
x = b // 2
y = c // 4
m = min(a, x)
n = min(m, y)
print(n + n * 2 + n * 4)


from collections import deque, Counter
import array
from itertools import combinations, permutations
from math import sqrt
import unittest

def read_int():
	return int(input().strip())

def read_int_array():
	return [int(i) for i in input().strip().split(' ')]
a = read_int()
b = read_int()
c = read_int()
x = min(a, b // 2, c // 4)
print(x + x * 2 + x * 4)


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


a = int(input())
b = int(input())
c = int(input())
l = [0]
for i in range(1, a + 1):
	if b >= 2 * i and c >= 4 * i:
		x = i + 2 * i + 4 * i
		l.append(x)
print(max(l))


a = int(input())
b = int(input())
c = int(input())
x = min(a, b // 2, c // 4)
print(x * 1 + x * 2 + x * 4)


N = [int(input()) for _ in range(3)]
for _ in range(N[0], 0, -1):
	if _ * 4 <= N[2] and _ * 2 <= N[1]:
		print(_ + _ * 2 + _ * 4)
		exit()
print(0)


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


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


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)


a = int(input())
b = int(input())
c = int(input())
flag = False
for i in range(1, a + 1):
	if (i * 2 <= b) & (i * 4 <= c):
		res = i + i * 2 + i * 4
		flag = True
if flag:
	print(res)
else:
	print('0')


n = int(input())
m = int(input())
l = int(input())
s = 0
while 1 > 0:
	if n >= 1 and m >= 2 and (l >= 4):
		s = s + 7
		n = n - 1
		m = m - 2
		l = l - 4
	else:
		break
print(s)


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


lemon = int(input())
apple = int(input()) // 2
pears = int(input()) // 4
print(min(lemon, apple, pears) * 7)


lem = int(input())
app = int(input())
pear = int(input())
num = 0
num_1 = 0
num_2 = 0
if lem < 1 or (app < 2 and pear < 4):
	print('0')
else:
	while num < lem and num_1 < app and (num_2 < pear):
		num += 1
		num_1 += 2
		num_2 += 4
	if num > lem or num_1 > app or num_2 > pear:
		num -= 1
		num_1 -= 2
		num_2 -= 4
	print(num + num_1 + num_2)


import math
n = int(input())
l = int(input())
k = int(input())
x = math.floor(n / 1)
y = math.floor(l / 2)
z = math.floor(k / 4)
if x == 0 or y == 0 or z == 0:
	print(0)
	exit()
zx = min(x, y, z)
print(zx * 4 + zx * 2 + zx)


a = int(input())
b = int(input())
c = int(input())
a = a // 1
b = b // 2
c = c // 4
p = min(a, b, c)
q = p * 1 + p * 2 + p * 4
print(q)


a = int(input())
b = int(input())
c = int(input())
t = 0
if b < 2 or c < 4 or a < 1:
	print('0')
else:
	t = min(a, b // 2, c // 4) * 7
	print(t)


l = int(input())
a = int(input())
p = int(input())
lin = l
ain = int(a / 2)
pin = int(p / 4)
l = [lin, ain, pin]
l.sort()
print(str(7 * l[0]))


x = int(input())
y = int(input())
z = int(input())
m = min(x // 1, y // 2, z // 4)
print(m * 1 + m * 2 + m * 4)


(a, b, c) = [int(input()) for i in range(3)]
(ans, m) = (0, min(a // 1, b // 2, c // 4))
if m == 0:
	exit(print(0))
ans = m * (1 + 2 + 4)
print(ans)


(a, b, c) = [int(input()) for i in range(3)]
while (2 * a > b or 4 * a > c) and a > 0:
	a -= 1
print(7 * a)


a = int(input())
b = int(input())
c = int(input())
p = 0
q = 0
r = 0
i = 1
while i <= a:
	if i * 2 <= b and i * 4 <= c:
		p = i
		q = i * 2
		r = i * 4
	else:
		break
	i += 1
print(p + q + r)


a = int(input())
b = int(input())
c = int(input())
n = 0
for i in range(0, a + 1):
	r = s = i
	if i * 2 <= b and i * 4 <= c:
		s += i * 2 + i * 4
	if r == s:
		s = 0
	n = max(s, n)
print(n)


Ain = input()
Bin = input()
Cin = input()
a = int(Ain)
b = int(Bin)
c = int(Cin)
i = 1
while True:
	if a < i or b < 2 * i or c < 4 * i:
		i = i - 1
		break
	i = i + 1
print(str(7 * i))


a = int(input())
b = int(input())
c = int(input())
status = True
while status:
	if c % 4 == 0 and b % 2 == 0:
		break
	elif c % 4 != 0:
		c -= 1
	else:
		b -= 1
if b >= 2 and c >= 4:
	x = min(a, b // 2, c // 4)
	if x == a:
		print(7 * a)
	elif x == b // 2:
		print(int(3.5 * b))
	else:
		print(int(1.75 * c))
else:
	print(0)


a = int(input())
b = int(input())
c = int(input())
(x, y, z) = (1, 2, 4)
cnt = 0
while a >= x and b >= y and (c >= z):
	cnt += 7
	a -= x
	b -= y
	c -= z
print(cnt)


def solve(lemons, apples, pears):
	oneCompote = 1 + 2 + 4
	l = lemons / 1
	a = int(apples / 2)
	p = int(pears / 4)
	return int(min(l, a, p) * oneCompote)
lemons = int(input())
apples = int(input())
pears = int(input())
print(solve(lemons, apples, pears))


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


l = int(input())
a = int(input())
p = int(input())
count = 0
while l >= 1 and a >= 2 and (p >= 4):
	l -= 1
	a -= 2
	p -= 4
	count += 7
print(count)


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)


L = int(input())
A = int(input())
P = int(input())
x = min(L, A // 2, P // 4)
print(x * 7)


a = int(input())
b = int(input())
c = int(input())
done = False
for lemons in range(1, a + 2):
	if lemons * 2 > b or lemons * 4 > c:
		thelemons = lemons - 1
		print(thelemons * 7)
		done = True
		break
if not done:
	print(a * 7)


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


a = input()
b = input()
c = input()
a = int(a)
b = int(b)
c = int(c)
ans = 0
count = 1000
while count >= 0:
	x = int(count / 4)
	y = int(count / 2)
	z = int(count)
	if a >= x and b >= y and (c >= z):
		ans = x + y + z
		break
	count -= 4
ans = int(ans)
print(ans)


(a, b, c) = (int(input()), int(input()), int(input()))
i = 1000
while i >= 0 and (a < i or b < 2 * i or c < 4 * i):
	i -= 1
print(i * 7)


lemon = int(input())
apple = int(input())
pears = int(input())
ans = 0
for i in range(1, 251):
	if lemon >= 1 and apple >= 2 and (pears >= 4):
		lemon -= 1
		apple -= 2
		pears -= 4
		ans += 1
	else:
		break
print(ans * 7)


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, copy, functools
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return [int(x) for x in sys.stdin.readline().split()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().split()]

def LS():
	return sys.stdin.readline().split()

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def S():
	return input()

def pf(s):
	return print(s, flush=True)

def main():
	a = [I() for _ in range(3)]
	m = inf
	for i in range(3):
		t = a[i] // 2 ** i
		if m > t:
			m = t
	return m * 7
print(main())


l = int(input())
a = int(input())
p = int(input())
value = False
for i in range(l, 0, -1):
	sum = 0
	for j in range(a, 0, -1):
		if j == 2 * i:
			for k in range(p, 0, -1):
				if k == 4 * i:
					value = True
					sum = i + j + k
					print(sum)
					break
		if value:
			break
	if value:
		break
if value == False:
	print('0')


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


fruit = list()
for i in range(0, 3):
	x = int(input())
	fruit.append(x)
for a in range(fruit[0], -1, -1):
	if fruit[1] >= a * 2 and fruit[2] >= a * 4:
		print(a + a * 2 + a * 4)
		break


n1 = int(input())
n2 = int(input())
n3 = int(input())
n2 = n2 // 2
n3 = n3 // 4
mini = min(n1, n2, n3)
print(mini * 1 + mini * 2 + mini * 4)


while True:
	try:
		a = int(input()) // 1
		b = int(input()) // 2
		c = int(input()) // 4
		fruit = [a, b, c]
		m = min(fruit)
		print(m * 7)
	except EOFError:
		break


l = int(input())
a = int(input()) // 2
p = int(input()) // 4
if a > l:
	a = l
if a > p:
	a = p
print(7 * a)


a = int(input())
b = int(input())
c = int(input())
if a <= b // 2 and a <= c // 4:
	print(a + a * 2 + a * 4)
elif b // 2 <= c // 4:
	print(b // 2 + b // 2 * 2 + b // 2 * 4)
else:
	print(c // 4 + c // 4 * 2 + c // 4 * 4)


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


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


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


L = int(input(''))
M = int(input(''))
P = int(input(''))
l = 1
m = 2
p = 4
c = 0
while l <= L and m <= M and (p <= P):
	l += 1
	m += 2
	p += 4
	c += 7
print(c)


a = [int(input()) for _ in range(3)]
res = 0
while a[0] >= 1 and a[1] >= 2 and (a[2] >= 4):
	res += 7
	a[0] -= 1
	a[1] -= 2
	a[2] -= 4
print(res)


pears = int(input())
lemons = int(input())
apples = int(input())
apples = int(apples / 4)
lemons = int(lemons / 2)
total_num = pears
if total_num > apples:
	total_num = apples
if total_num > lemons:
	total_num = lemons
total_fruit = total_num * 4 + total_num * 2 + total_num
print(total_fruit)


import math

def solve(a, b, c):
	minx = min(a // 1, b // 2, c // 4)
	return minx * 7
a = int(input())
b = int(input())
c = int(input())
print(solve(a, b, c))


a = int(input())
b = int(input())
c = int(input())
cont = 0
while True:
	if a >= 1 and b >= 2 and (c >= 4):
		cont += 1
		a -= 1
		b -= 2
		c -= 4
	else:
		break
print(cont * 7)


l = int(input())
a = int(input())
p = int(input())
if l < 1 or a < 2 or p < 4:
	x = 0
else:
	for i in range(1, l + 1):
		l = l - 1
		a = a - 2
		p = p - 4
		if l == 0 or a < 2 or p < 4:
			x = i
			break
print(7 * x)


a = int(input())
b = int(input())
c = int(input())
b = round((b - b % 2) / 2)
c = round((c - c % 4) / 4)
if a > b:
	if b > c:
		print(c * 7)
	else:
		print(b * 7)
elif a > c:
	print(c * 7)
else:
	print(a * 7)


a = int(input())
b = int(input())
c = int(input())
i = 0
for i in range(a + 1):
	if i * 2 <= b and i * 4 <= c:
		d = i + i * 2 + i * 4
print(d)


import math
a = int(input())
a = min(math.floor(int(input()) / 2), a)
a = min(math.floor(int(input()) / 4), a)
print(7 * a)


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


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


import sys
(a, b, c) = map(int, sys.stdin.read().split())
print(min(a, b >> 1, c >> 2) * 7)


a = int(input())
b = int(input())
c = int(input())
i = a * 2
z = a * 4
while i > b or z > c:
	a -= 1
	i = a * 2
	z = a * 4
print(a * 7)


def calculate(a, b, c):
	quantity_a = a
	quantity_b = b // 2
	quantity_c = c // 4
	min_quantity = min(quantity_a, quantity_b, quantity_c)
	return min_quantity + min_quantity * 2 + min_quantity * 4
a = int(input())
b = int(input())
c = int(input())
quantity = calculate(a, b, c)
print(quantity)


print(7 * min(int(input()), int(input()) >> 1, int(input()) >> 2))


import math
a = int(input())
b = int(input())
c = int(input())
a_ = a
faux = True
while a_:
	if a_ * 2 <= b and a_ * 4 <= c:
		print(a_ + a_ * 2 + a_ * 4)
		faux = True
		break
	else:
		faux = False
	a_ = a_ - 1
if not faux:
	print(0)


import sys
input = sys.stdin.readline
ins = lambda : input().rstrip()
ini = lambda : int(input().rstrip())
inm = lambda : map(int, input().rstrip().split())
inl = lambda : list(map(int, input().split()))
out = lambda x, s='\n': print(s.join(map(str, x)))
a = ini()
b = ini()
c = ini()
print(7 * min(a, b // 2, c // 4))


a = int(input()) // 1
b = int(input()) // 2
c = int(input()) // 4
cnt = min(a, b, c)
print((1 + 2 + 4) * cnt)


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


n = int(input())
m = int(input())
p = int(input())
if n >= 1 and m >= 2 and (p >= 4):
	m = m // 2
	p = p // 4
	k = min(n, m, p)
	print(k + k * 2 + k * 4)
else:
	print(0)


a = int(input())
b = int(input())
c = int(input())
k = c // 4
if k * 2 > b:
	k = b // 2
if k > a:
	k = a
print(k * 7)


k = int(input())
n = int(input())
w = int(input())
if n // 2 == 0 or w // 4 == 0:
	print(0)
else:
	print(min(k, n // 2, w // 4) * 7)


a = int(input())
b = int(input())
c = int(input())
kolGr = c // 4
kolYab = b // 2
while c != 2 * b or b != 2 * a:
	while c != 2 * b:
		if c > 2 * b:
			c = c - 1
		else:
			b = b - 1
	while b != 2 * a:
		if b > 2 * a:
			b = b - 1
		else:
			a = a - 1
print(a + b + c)


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


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


lemons = int(input())
apple = int(input())
pears = int(input())
ratio = [1, 2, 4]
count = 0
while 1:
	if lemons - ratio[0] >= 0:
		lemons -= ratio[0]
		if apple - ratio[1] >= 0:
			apple -= ratio[1]
			if pears - ratio[2] >= 0:
				pears -= ratio[2]
				count += ratio[1] + ratio[2] + ratio[0]
			else:
				break
		else:
			break
	else:
		break
print(str(count))


import os
LOCAL_PC = 'n1amr' in os.path.expanduser('~')

def process_file(in_name, out_name):
	with open(in_name, 'r') as fin:
		with open(out_name, 'w') as fout:

			def read():
				return fin.readline().rstrip('\n')

			def write(*args, end='\n'):
				text = ' '.join(map(str, args)) + end
				fout.write(text)
				print(text, end='')
			t = int(fin.readline())
			for i in range(t):
				read()
				write('Case #{T}: \n'.format(T=i + 1), end='')
				solve(read, write)
				write()

def process_stdio():

	def read():
		return input()

	def write(*args, end='\n'):
		print(*args, end=end)
	solve(read, write)

def solve(input, print):
	(a, b, c) = [int(input()) for _ in range(3)]
	b //= 2
	c //= 4
	r = min(a, b, c)
	print(7 * r)
if LOCAL_PC:
	in_name = __file__[:-3] + '.in'
	out_name = __file__[:-3] + '.out'
	process_file(in_name, out_name)
else:
	process_stdio()


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


(l, a, p) = (int(input()), int(input()), int(input()))
res = min(l, a // 2, p // 4) * 7
print(res, flush=True)


i = int(input())
x = i
i = int(input())
if i // 2 < x:
	x = i // 2
i = int(input())
if i // 4 < x:
	x = i // 4
print(str(7 * x))


import sys, math, string
input = sys.stdin.readline
L = lambda : list(map(int, input().split()))
Ls = lambda : list(input().split().strip())
M = lambda : map(int, input().split())
a = int(input())
b = int(input())
c = int(input())
k = min(a, b // 2, c // 4)
print(7 * k)


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 = int(input())
b = int(input())
c = int(input())
total = 0
if b < 2 or c < 4 or a < 1:
	total = 0
else:
	for i in range(a, 0, -1):
		if i * 2 <= b and i * 4 <= c:
			total = i + i * 2 + i * 4
			break
print(total)


a = int(input())
b = int(input())
c = int(input())
diff1 = a // 1
diff2 = b // 2
diff3 = c // 4
check = [diff1, diff2, diff3]
final = min(check)
print(7 * final)


x = int(input())
y = int(input())
z = int(input())
y = y / 2
z = z / 4
a = min(y, z)
print(7 * int(min(x, a)))


def kompot(a, b, c):
	z = list()
	for i in range(1, a + 1):
		if 2 * i <= b and 4 * i <= c:
			z.append(i)
	if not z:
		return 0
	return max([7 * elem for elem in z])
A = int(input())
B = int(input())
C = int(input())
print(kompot(A, B, C))


a = int(input())
b = int(input())
c = int(input())
x = min(a, b, c)
s = 0
for i in range(x):
	if (a >= 1 and b >= 2) and c >= 4:
		s = s + 7
		a = a - 1
		b = b - 2
		c = c - 4
print(s)


ans = 1001
for i in (1, 2, 4):
	ans = min(ans, int(input()) // i)
print(ans * 7)


l = int(input())
a = int(input())
g = int(input())
l1 = [l, a, g]
while l > 0:
	if a >= 2 and g >= 4:
		l -= 1
		a -= 2
		g -= 4
	else:
		break
print(l1[0] - l + (l1[1] - a) + (l1[2] - g))


lemon = int(input())
apple = int(input())
pear = int(input())
l = lemon // 1
a = apple // 2
p = pear // 4
factors = [l, a, p]
print(7 * min(factors))


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


a = int(input())
b = int(input())
c = int(input())
ans = min(a // 1, b // 2, c // 4)
print(1 * ans + 2 * ans + 4 * ans)


import math
import os
import random
import re
import sys
a = int(input())
b = int(input())
c = int(input())
d = 0
s = 0
while d == 0 and c > 0:
	if c % 4 == 0:
		k = c // 4
		t = c // 2
		if t / k == 2 and k <= a and (t <= b):
			d = 1
			s = c + k + t
			break
		else:
			c = c - 4
			continue
	else:
		c = c - c % 4
if d == 1:
	print(s)
else:
	print(0)


fruitCounts = []
for i in [0, 1, 2]:
	fruitCounts.append(int(input()))
ratio = (1, 2, 4)

def youCanKeepCounting(lemonCount):
	verdict = True
	for i in range(len(ratio)):
		verdict = verdict and ratio[i] * (lemonCount + 1) <= fruitCounts[i]
	return verdict
(lemonCount, keepCounting) = (0, True)
while keepCounting:
	if youCanKeepCounting(lemonCount):
		lemonCount = lemonCount + 1
	else:
		keepCounting = False
print(lemonCount + lemonCount * 2 + lemonCount * 4)


a = [int(input()) for i in range(3)]
a[0] //= 1
a[1] //= 2
a[2] //= 4
x = min(a)
if x > 0:
	print(7 * x)
else:
	print(0)


a = int(input())
b = int(input())
c = int(input())
b = b // 2
c = c // 4
if a <= b:
	d = a
else:
	d = b
if d > c:
	d = c
d *= 7
print(d)


a = int(input())
b = int(input())
c = int(input())
if a < 1 or b < 2 or c < 4:
	print(0)
else:
	b1 = b // 2
	c1 = c // 4
	mn = min(b1, c1, a)
	ans = mn * 1 + mn * 2 + mn * 4
	print(ans)


x = int(input())
y = int(input())
z = int(input())
a = int(x)
b = int(y / 2)
c = int(z / 4)
m = min(a, b, c)
print(m * 1 + m * 2 + m * 4)


lemon = int(input())
apples = int(input())
pears = int(input())
_all = 0
while lemon != 0:
	lemon -= 1
	if apples >= 2:
		apples -= 2
	else:
		break
	if pears >= 4:
		pears -= 4
	else:
		break
	_all += 7
print(_all)


def main():
	[a, b, c] = [int(input()) for _ in range(3)]
	b //= 2
	c //= 4
	n_compote = min(a, b, c)
	print(n_compote * 7)
main()


a = int(input())
b = int(input())
c = int(input())
for i in reversed(range(1001)):
	if a >= i and b >= 2 * i and (c >= 4 * i):
		print(7 * i)
		exit()


l = int(input())
a = int(input())
p = int(input())
p = min(l, a // 2, p // 4)
print(p + 2 * p + 4 * p)


n = int(input())
m = int(input())
l = int(input())
d = 0
for i in range(n, 0, -1):
	if 2 * i <= m and 4 * i <= l:
		d = d + 7 * i
		break
print(d)


l = int(input())
a = int(input())
p = int(input())
l1 = 1
a1 = 2
p1 = 4
res = 0
while l >= l1 and a >= a1 and (p >= p1):
	l = l - l1
	a = a - a1
	p = p - p1
	res += 7
print(res)


def main():
	a = int(input())
	b = int(input())
	c = int(input())
	ans = 0
	for i in range(0, a + 1):
		if i * 2 <= b and i * 4 <= c:
			ans = i * 7
		else:
			break
	print(ans)
main()


l = int(input())
a = int(input())
p = int(input())
flag = 0
while l > 0:
	r2 = a // l
	r3 = p // l
	if r2 >= 2 and r3 >= 4:
		flag = 1
		break
	else:
		l -= 1
if flag == 1:
	print(l * 7)
if l == 0:
	print('0')


nl = int(input())
na = int(input())
np = int(input())
t = min(nl, na // 2, np // 4)
print(t * 7)


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


lemon = int(input())
apple = int(input())
pears = int(input())
x = apple // 2
y = pears // 4
total = min(lemon, min(x, y))
print(7 * total)


l = int(input())
a = int(input())
p = int(input())
if p >= 4 and a >= 2 and (l >= 1):
	p = min(p // 4, min(a // 2, l))
	a = min(a // 2, p)
	l = min(p, a)
	if l == 0 or a == 0 or p == 0:
		print(0)
	else:
		print(l + 2 * a + 4 * p)
else:
	print(0)


def main():
	a = int(input())
	b = int(input())
	c = int(input())
	print(solver(a, b, c))

def solver(a, b, c):
	return 7 * min(a, b // 2, c // 4)
main()


a = int(input())
b = int(input())
c = int(input())
a1 = a
for i in range(a1, -1, -1):
	if i == 0:
		print(0)
		break
	elif 2 * i <= b and 4 * i <= c:
		x = i + 2 * i + 4 * i
		print(x)
		break


a = int(input())
b = int(input())
c = int(input())
ac = a // 1
bc = b // 2
cc = c // 4
x = min(ac, bc, cc)
ar = 1 * x
br = 2 * x
cr = 4 * x
print(ar + br + cr)


a = int(input())
b = int(input())
c = int(input())
n = []
n.append(a)
n.append(b // 2)
n.append(c // 4)
n.sort()
print(n[0] * 7)


import sys
a = int(input())
b = int(input())
c = int(input())
res = 0
while a >= 1:
	if 2 * a <= b and 4 * a <= c:
		res = a + 2 * a + 4 * a
		break
	a -= 1
print(res)


import sys
a = int(sys.stdin.readline())
b = int(sys.stdin.readline())
c = int(sys.stdin.readline())
mk = min(a // 1, b // 2, c // 4)
r = 0
print(mk * 7)


k = int(input()) // 1
a = [2, 4]
for i in range(2):
	n = int(input()) // a[i]
	if n < k and n != 0:
		k = n
	elif n == 0:
		print(0)
		break
else:
	print(k * 7)


x = int(input())
y = int(input())
z = int(input())
ans = min(x, int(y / 2), int(z / 4)) * 7
print(ans)


l = int(input())
a = int(input())
p = int(input())
tl = 1
ta = 2
tp = 4
while tl + 1 <= l and ta + 2 <= a and (tp + 4 <= p):
	tl += 1
	ta += 2
	tp += 4
if tl > l or ta > a or tp > p:
	print(0)
else:
	print(ta + tl + tp)


a = int(input())
b = int(input())
c = int(input())
d = 0
while True:
	if a == 0 or b == 0 or c == 0:
		break
	if a * 2 <= b and a * 4 <= c:
		d = a + a * 2 + a * 4
	else:
		a -= 1
	if a == 1 and a * 2 > b:
		break
	elif a == 1 and a * 4 > c:
		break
	if d != 0:
		break
print(d)


def solve(test):
	a = int(input())
	b = int(input())
	c = int(input())
	print(7 * min(a, min(b // 2, c // 4)))
t = 1
for _ in range(t):
	solve(_ + 1)


fruits = []
for i in range(3):
	fruits.append(int(input()))
(a, b, c) = fruits
while b != 2 * a or c != 2 * b:
	while c != 2 * b:
		if 2 * b < c:
			c -= 1
		else:
			b -= 1
	while b != 2 * a:
		if b < 2 * a:
			a -= 1
		else:
			b -= 1
if a == 0 or b == 0 or c == 0:
	print(0)
else:
	print(a + b + c)


def main():
	x = int(input())
	y = int(input()) // 2
	z = int(input()) // 4
	p = min([x, y, z])
	return p * 7
print(main())


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

def Ans(a, b, c):
	base = 0
	aa = 1
	bb = 2
	cc = 4
	while a >= aa and b >= bb and (c >= cc):
		base += 1
		aa += 1
		bb = aa * 2
		cc = aa * 4
	ans = base + base * 2 + base * 4
	return ans
print(Ans(a, b, c))


def ii():
	return int(input())

def mi():
	return map(int, input().split())

def si():
	return [int(x) for x in input().split()]

def ss():
	return [x for x in input()]
(a, b, c) = (ii(), ii(), ii())
a *= 4
b *= 2
print(min(a, b, c) // 4 * 7)


A = int(input())
B = int(input())
C = int(input())
for i in range(A, -1, -1):
	if B >= 2 * i and C >= 4 * i:
		print(7 * i)
		break


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


a = int(input())
b = int(input())
c = int(input())
a2 = a
b2 = 0
c2 = 0
for i in range(a, 0, -1):
	if b // 2 != 0 and c // 4 != 0:
		b2 += 2
		c2 += 4
		a2 -= 1
		b -= 2
		c -= 4
result = b2 + c2 + (a - a2)
print(result)


l = int(input())
a = int(input())
p = int(input())
count = 0
if l >= 1 and a >= 2 and (p >= 4):
	pc = int(p / 4)
	ac = int(a / 2)
	num = min(l, min(pc, ac))
	print(num + num * 2 + num * 4)
else:
	print(0)


a = int(input())
b = int(input())
c = int(input())
(d, e, g) = (1, 2, 4)
h = 0
for i in range(a):
	if a - d >= 0 and b - e >= 0 and (c - g >= 0):
		(a, b, c) = (a - d, b - e, c - g)
		h += d + e + g
	else:
		break
print(h)


l = int(input())
a = int(input())
p = int(input())
(m, n, total) = (0, 0, 0)
m = min(l, p // 4)
n = min(m, a // 2)
total = 7 * n
print(total)


from collections import defaultdict
import sys, os, math
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())
mn = c // 4
if b // 2 < mn:
	mn = b // 2
if a < mn:
	mn = a
print(1 * mn + 2 * mn + 4 * mn)


a = int(input())
b = int(input())
c = int(input())
x = a // 1
y = b // 2
z = c // 4
m = min(x, y, z)
nx = 1 * m
ny = 2 * m
nz = 4 * m
print(nx + ny + nz)


def io():
	a = int(input())
	b = int(input())
	c = int(input())
	return [a, b, c]

def solve():
	(a, b, c) = io()
	ans = 0
	i = 0
	while i != a:
		tmp = a - i
		if tmp * 2 <= b and tmp * 4 <= c:
			ans = tmp
			break
		i += 1
	an = 1 * ans + 2 * ans + 4 * ans
	print(an)
solve()


from __future__ import division, print_function
from fractions import Fraction
import sys
import os
from io import BytesIO, IOBase
from itertools import *
import bisect
from heapq import *
from math import *
from copy import *
from collections import deque
from collections import Counter as counter
from itertools import combinations as comb
from itertools import permutations as permutate
from bisect import bisect_left as bl
from bisect import bisect_right as br
from bisect import bisect
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
from types import GeneratorType

def iterative(f, stack=[]):

	def wrapped_func(*args, **kwargs):
		if stack:
			return f(*args, **kwargs)
		to = f(*args, **kwargs)
		while True:
			if type(to) is GeneratorType:
				stack.append(to)
				to = next(to)
				continue
			stack.pop()
			if not stack:
				break
			to = stack[-1].send(to)
		return to
	return wrapped_func
mod = 1000000007

def inp():
	return sys.stdin.readline().rstrip('\r\n')

def out(var):
	sys.stdout.write(str(var))

def lis():
	return list(map(int, inp().split()))

def stringlis():
	return list(map(str, inp().split()))

def sep():
	return map(int, inp().split())

def strsep():
	return map(str, inp().split())

def zerolist(n):
	return [0] * n

def nextline():
	out('\n')

def testcase(t):
	for p in range(t):
		solve()

def printlist(a):
	for p in range(0, len(a)):
		out(str(a[p]) + ' ')

def gcd(a, b):
	if a == b:
		return a
	while b > 0:
		(a, b) = (b, a % b)
	return a

def lcm(a, b):
	return abs(a // gcd(a, b) * b)

def primesbelow(N):
	correction = N % 6 > 1
	N = {0: N, 1: N - 1, 2: N + 4, 3: N + 3, 4: N + 2, 5: N + 1}[N % 6]
	sieve = [True] * (N // 3)
	sieve[0] = False
	for i in range(int(N ** 0.5) // 3 + 1):
		if sieve[i]:
			k = 3 * i + 1 | 1
			sieve[k * k // 3::2 * k] = [False] * ((N // 6 - k * k // 6 - 1) // k + 1)
			sieve[(k * k + 4 * k - 2 * k * (i % 2)) // 3::2 * k] = [False] * ((N // 6 - (k * k + 4 * k - 2 * k * (i % 2)) // 6 - 1) // k + 1)
	return [2, 3] + [3 * i + 1 | 1 for i in range(1, N // 3 - correction) if sieve[i]]
smallprimeset = set(primesbelow(100000))

def solve():
	a = int(inp())
	b = int(inp())
	c = int(inp())
	print(min(a // 1, b // 2, c // 4) * 7)
solve()


a = int(input())
b = int(input())
c = int(input())
total = 0
for i in range(a, 0, -1):
	lemon = i
	apple = 2 * i
	pear = 4 * i
	if apple <= b and pear <= c:
		total = lemon + apple + pear
		break
print(total)


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 = int(input())
b = int(input())
c = int(input())
if a < 1 or b < 2 or c < 4:
	print(0)
else:
	x = a
	y = b // 2
	z = c // 4
	p = min(x, min(y, z))
	sum = p * 7
	print(sum)


a = int(input())
b = int(input())
c = int(input())
flag = 0
for i in reversed(range(1, a + 1)):
	if 2 * i <= b and 4 * i <= c:
		print(7 * i)
		flag = 1
		break
if flag == 0:
	print(0)


a = int(input())
b = int(input())
c = int(input())
i = 1
ans = 0
while i <= a:
	if 2 * i <= b:
		if 4 * i <= c:
			ans = i + 2 * i + 4 * i
		else:
			break
	else:
		break
	i = i + 1
print(ans)


i = input
a = int(i())
b = int(i())
c = int(i())
z = min(a, b // 2, c // 4)
print(z + z * 2 + z * 4)


a = int(input())
b = int(input())
c = int(input())
ans1 = a // 1
ans2 = b // 2
ans3 = c // 4
ans = min(ans1, ans2, ans3)
print(ans * 1 + ans * 2 + ans * 4)


a = int(input())
b = int(input())
c = int(input())
if c // 4 == 0 or b // 2 == 0 or a == 0:
	print(0)
elif b // 2 < c // 4:
	if a > b // 2:
		print(b // 2 + b // 2 * 2 + b // 2 * 4)
	else:
		print(a + a * 2 + a * 4)
elif a > c // 4:
	print(c // 4 + c // 4 * 2 + c // 4 * 4)
else:
	print(a + a * 2 + a * 4)


__author__ = 'artyom'

def main():
	a = read()
	b = read()
	c = read()
	return 7 * min(a, b // 2, c // 4)

def read(mode=1, size=None):
	if mode == 0:
		return input().strip()
	if mode == 1:
		return int(input().strip())
	if mode == 2:
		return input().strip().split()
	if mode == 3:
		return list(map(int, input().strip().split()))
	a = []
	for _ in range(size):
		a.append(read(3))
	return a

def write(s='\n'):
	if s is None:
		s = ''
	if isinstance(s, tuple) or isinstance(s, list):
		s = ' '.join(map(str, s))
	s = str(s)
	print(s, end='\n')
write(main())


a = int(input())
b = int(input())
c = int(input())
p = a // 1
q = b // 2
r = c // 4
x = min(p, q, r)
print(7 * x)


def howMany(x, y, z):
	return min(x // 1, y // 2, z // 4) * 7
xLemons = int(input())
yApples = int(input())
zPears = int(input())
print(howMany(xLemons, yApples, zPears))


a = int(input())
b = int(input())
c = int(input())
(i, s) = (1, 0)
while True:
	an = 1 * i
	bn = 2 * i
	cn = 4 * i
	if an <= a and bn <= b and (cn <= c):
		i = i + 1
		continue
	else:
		print(1 * (i - 1) + 2 * (i - 1) + 4 * (i - 1))
		break


x = int(input())
y = int(input())
z = int(input())

def checkr(a, b, c):
	if b >= a * 2:
		if c >= b * 2:
			return 0
		else:
			return -1
	else:
		return -2
o = 0
while x != 0 or y != 0:
	if checkr(x, y, z) == -1:
		y -= 1
	if checkr(x, y, z) == -2:
		x -= 1
	if checkr(x, y, z) == 0:
		o = x
		print(o * 7)
		break


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


import math
from fractions import Fraction as frac
MOD = 1000000000.0 + 7

def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)

def lcm(a, b):
	return a * b // gcd(a, b)

def solve(case_no):
	a = int(input())
	b = int(input())
	c = int(input())
	print(min(a, b // 2, c // 4) * 7)
t = 1
for i in range(1, t + 1):
	solve(i)


a = int(input())
b = int(input())
c = int(input())
i = 1
while i <= a and i * 2 <= b and (i * 4 <= c):
	i += 1
i -= 1
print(i + i * 2 + i * 4)


a = int(input())
b = int(input())
c = int(input())
i = 1
stop = 0
while stop != 1:
	if a >= i * 1 and b >= i * 2 and (c >= i * 4):
		i += 1
	else:
		i -= 1
		stop = 1
print(i * 1 + i * 2 + i * 4)


a = int(input())
b = int(input())
c = int(input())
a1 = c // 4
a2 = b // 2
a = min(a, a1, a2)
print(a + 2 * a + 4 * a)


a = int(input())
b = int(input())
c = int(input())
x = a
while True:
	if b >= x * 2:
		if c >= x * 4:
			break
		else:
			x -= 1
	else:
		x -= 1
print(x * 7)


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


x = int(input())
y = int(input())
z = int(input())
while x > 0:
	if y >= 2 * x and z >= 4 * x:
		print(x + 2 * x + 4 * x)
		exit(0)
	x -= 1
print(0)


(a, b, c) = (int(input()), int(input()), int(input()))
for x in range(a, -1, -1):
	if 2 * x <= b and 4 * x <= c:
		print(7 * x)
		break


a = int(input())
b = int(input())
c = int(input())
f = 0
for i in range(a):
	if b >= 2 and c >= 4:
		b = b - 2
		c = c - 4
		f = f + 7
print(f)


a = int(input())
b = int(input())
c = int(input())
p = 0
if a == 0:
	print(0)
else:
	while a > 0:
		if b < 0 or c < 0:
			b = b + 2 * a
			c = c + 4 * a
			p -= 2 * a + 4 * a
			a = a - 1
		if p == 6 * a:
			print(p + a)
			break
		p += 2 * a + 4 * a
		b = b - 2 * a
		c = c - 4 * a
if p != 6 * a:
	print(0)


a = int(input())
b = int(input())
c = int(input())
count = 0
for i in range(a, -1, -1):
	if b >= 2 * i and c >= 4 * i:
		print(i + 2 * i + 4 * i)
		break


def get_int():
	return map(int, input().split())
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())
m_a = a
m_b = b // 2
m_c = c // 4
print(min(m_a, m_b, m_c) * 7)


lemon = int(input())
apple = int(input())
pears = int(input())
(a, b, c) = (0, 0, 0)
count = -1
while lemon >= a and apple >= b and (pears >= c):
	a = a + 1
	b = b + 2
	c = c + 4
	count = count + 1
print(count * 7)


a = int(input())
b = int(input())
c = int(input())
x = 0
while 1:
	if a < 1 or b < 2 or c < 4:
		break
	x += 1
	a -= 1
	b -= 2
	c -= 4
print(7 * x)


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


limonKati = int(int(input()) / 1)
elmaKati = int(int(input()) / 2)
armutKati = int(int(input()) / 4)
print(min(limonKati, elmaKati, armutKati) * 7)


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


__author__ = 'ActiveChooN Dusted'
a = int(input())
b = int(input())
c = int(input())
fruitMin = min(a, b // 2, c // 4)
print(fruitMin * 7)


def swap(i, j):
	ii = a[i]
	a[i] = a[j]
	a[j] = ii

def Bubble_sort(n, a):
	for i in range(n):
		for j in range(n - 1):
			if a[j] > a[j + 1]:
				swap(j, j + 1)
	return a

def r_shift(n, m, k, a):
	for i in range(n - 1, m - 2, -1):
		a[i] = a[i - 1]
	a[m - 1] = k
	return a

def l_shift(n, m, k, a):
	for i in range(m - 1, n - 1):
		a[i] = a[i + 1]
	a[n - 1] = k
	return a
a = int(input())
b = int(input())
c = int(input())
print(7 * min(a // 1, b // 2, c // 4))


lemon = int(input())
apple = int(input())
pear = int(input())
x = sorted([lemon, apple // 2, pear // 4])
print(x[0] * 7)


a = int(input())
b = int(input())
c = int(input())
a2 = a // 1
b2 = b // 2
c2 = c // 4
x = min(a2, b2, c2)
print(x * 7)


x = int(input())
y = int(input())
z = int(input())
c = min((x // 1, y // 2, z // 4))
print(7 * c)


a = int(input())
b = int(input())
c = int(input())
for i in range(1000):
	if a < i:
		break
	if b < 2 * i:
		break
	if c < 4 * i:
		break
print(7 * (i - 1))


a = int(input())
b = int(input())
c = int(input())
tot = a + b + c
import math
res1 = int(math.floor(a / 1))
res2 = int(math.floor(b / 2))
res3 = int(math.floor(c / 4))
res = min(res1, min(res2, res3)) * 7
if tot >= res:
	print(res)
else:
	print(0)


A = []
for i in range(3):
	A.append(int(input().strip()))
ans = min(A[0] // 1, A[1] // 2, A[2] // 4) * 7
print(ans)


a = int(input())
b = int(input())
c = int(input())
z = min(a, b, c)
if b >= 2 * a and c >= 4 * a:
	print(a + 2 * a + 4 * a)
else:
	while a != 0:
		if b >= 2 * a and c >= 4 * a:
			print(a + 2 * a + 4 * a)
			break
		a = a - 1
if a == 0:
	print(0)


a = int(input())
b = int(input())
c = int(input())
x = min(a, b // 2, c // 4)
if 1 * x <= a and 2 * x <= b and (3 * x <= c):
	print(7 * x)
else:
	print(0)


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


def main():
	nums = []
	for i in range(3):
		nums.append(int(input()))
	print(compote(nums[0], nums[1], nums[2]))

def compote(a, b, c):
	if b < 2 or c < 4:
		return 0
	if not b % 2 == 0:
		b -= 1
	if not c % 2 == 0:
		c -= 1
	greatest_b = min(b, c // 2 if c // 2 % 2 == 0 else c // 2 - 1)
	if a >= greatest_b / 2:
		return greatest_b // 2 + greatest_b + greatest_b * 2
	else:
		return a + a * 2 + a * 4
main()


a = int(input())
b = int(input())
c = int(input())
a_result = a // 1
b_result = b // 2
c_result = c // 4
minimum = min(a_result, b_result, c_result)
print(minimum * 7)


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


l = int(input())
a = int(input())
p = int(input())
c = [0]
for i in range(l, 0, -1):
	if 2 * i <= a and 4 * i <= p:
		c.append(7 * i)
		break
print(max(c))


x = int(input())
y = int(input())
z = int(input())
ans = 0
while x > 0 and y >= 2 and (z >= 4):
	x -= 1
	y -= 2
	z -= 4
	ans += 7
print(ans)


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


import math
from collections import *
import sys
from functools import reduce

def get_ints():
	return map(int, input().strip().split())

def get_list():
	return list(get_ints())

def get_string():
	return list(input().strip().split())

def printxsp(*args):
	return print(*args, end='')

def printsp(*args):
	return print(*args, end=' ')
DIRECTIONS = [[0, 1], [0, -1], [1, 0], [1, -1]]
NEIGHBOURS = [(i, j) for i in range(-1, 2) for j in range(-1, 2) if i != 0 or j != 0]
OrdUnicode_a = ord('a')
OrdUnicode_A = ord('A')
CAPS_ALPHABETS = {chr(i + OrdUnicode_A): i for i in range(26)}
SMOL_ALPHABETS = {chr(i + OrdUnicode_a): i for i in range(26)}
UGLYMOD = int(1000000000.0) + 7
SEXYMOD = 998244353
MAXN = int(100000.0) + 1
INFINITY = float('inf')
a = int(input())
b = int(input())
c = int(input())
print(7 * min(a, b // 2, c // 4))


l = int(input())
a = int(input())
p = int(input())
M = min(l // 1, a // 2, p // 4)
print(M * 7)


(a, b, c) = (int(input()), int(input()), int(input()))
for i in range(a, 0, -1):
	b1 = i * 2
	if b1 <= b:
		c1 = i * 4
		if c1 <= c:
			print(i + b1 + c1)
			quit()
print(0)


a = int(input())
b = int(input())
c = int(input())
num = 0
while True:
	if a > 0:
		a -= 1
	else:
		break
	if b > 1:
		b -= 2
	else:
		break
	if c > 3:
		c -= 4
	else:
		break
	num += 7
print(num)


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


def main():
	print(min((int(input()) // i for i in (1, 2, 4))) * 7)
main()


a = int(input())
b = int(input())
c = int(input())
n = c // 4
m = b // 2
if a <= n and a <= m:
	print(7 * a)
elif a <= n:
	print(7 * m)
elif a <= m:
	print(7 * n)
else:
	print(min(7 * n, 7 * m))


from sys import stdin, stdout
from collections import *
from math import ceil, floor, log, gcd
st = lambda : list(stdin.readline().strip())
li = lambda : list(map(int, stdin.readline().split()))
mp = lambda : map(int, stdin.readline().split())
inp = lambda : int(stdin.readline())
pr = lambda n: stdout.write(str(n) + '\n')
mod = 1000000007
INF = float('inf')

def solve():
	l = [inp() for i in range(3)]
	a = l[0]
	for i in range(a, 0, -1):
		if l[1] >= 2 * i and l[2] >= 4 * i:
			pr(7 * i)
			return
	pr(0)
for _ in range(1):
	solve()


x = int(input())
y = int(input())
z = int(input())
k = 0
for n in range(1, x + 1):
	if n <= x and 2 * n <= y and (4 * n <= z):
		k = n
		continue
	else:
		k = n - 1
		break
print(7 * k)


def main():
	from sys import stdin, stdout
	a = int(stdin.readline())
	b = int(stdin.readline())
	c = int(stdin.readline())
	minim = min((a, b // 2, c // 4))
	stdout.write(str(minim + minim * 2 + minim * 4))
main()


abc = [int(input()), int(int(input()) / 2), int(int(input()) / 4)]
m = 1000
for i in abc:
	if i < m:
		m = i
print(m * 7)


def Main(l, a, p):
	if (p <= a or p <= l) and p < 4:
		print(0)
	else:
		mn = min(l // 1, a // 2, p // 4)
		print(mn + mn * 2 + mn * 2 * 2)
l = int(input())
a = int(input())
p = int(input())
Main(l, a, p)


i = lambda : int(input())
print(min(i(), i() // 2, i() // 4) * 7)


l = int(input())
a = int(input())
p = int(input())
t = min(l // 1, a // 2, p // 4)
print(1 * t + 2 * t + 4 * t)


a = int(input())
b = int(input())
c = int(input())
d = []
for i in range(a):
	if b >= 2 * (a - i) and c >= 4 * (a - i):
		d.append(7 * (a - i))
if len(d) != 0:
	k = max(d)
	print(k)
else:
	print(0)


a = int(input())
b = int(input())
c = int(input())
while a >= 1:
	(x, y) = (b // a, c // a)
	if (x < 2 or y < 4) and a == 1:
		print(0)
		break
	elif x >= 2 and y >= 4:
		print(7 * a)
		break
	elif x < 2 or y < 4:
		a = a - 1


a = int(input())
b = int(input())
c = int(input())
tb = b // 2
tc = c // 4
m = min(a, tb, tc)
print(m + m * 2 + m * 4)


a = int(input())
b = int(input())
c = int(input())
ans = False
while c > 0 and (not ans):
	if c % 4 == 0 and int(c / 2) <= b and (int(c / 4) <= a):
		ans = True
	else:
		c -= 1
print(c + int(c / 2) + int(c / 4))


import sys

def main():
	a = int(sys.stdin.readline())
	b = int(sys.stdin.readline())
	c = int(sys.stdin.readline())
	k = 1001
	k = min(k, a)
	k = min(k, b // 2)
	k = min(k, c // 4)
	print(7 * k)
main()


from math import *
a = input()
b = input()
c = input()
a = int(a)
b = int(b)
c = int(c)
d = min(a // 1, b // 2)
d = int(d)
e = min(d, c // 4)
e = int(e)
if e == 0:
	print(0)
else:
	print(7 * e)


a = int(input())
b = int(input())
c = int(input())
bs = b // 2
cs = c // 4
ans = min(a, min(bs, cs))
total = ans + ans * 2 + ans * 4
print(total)


lemons = int(input())
appels = int(input())
peeers = int(input())
times = 0
if lemons >= 1 and appels >= 2 and (peeers >= 4):
	while lemons >= 1 and appels >= 2 and (peeers >= 4):
		lemons -= 1
		appels -= 2
		peeers -= 4
		times += 7
	print(times)
else:
	print('0')


import os
import sys
from io import BytesIO, IOBase

def main():
	a = int(input())
	b = int(input())
	c = int(input())
	ans = 0
	for x in range(1, 1000):
		if x <= a and 2 * x <= b and (4 * x <= c):
			ans = max(ans, x + 2 * x + 4 * x)
		else:
			break
	print(ans)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


a = [int(input()) for _ in range(3)]
print(min(a[0], a[1] // 2, a[2] // 4) * 7)


x = int(input())
y = int(input())
z = int(input())
y = y // 2
z = z // 4
r = min(x, y, z)
print(r + r * 2 + r * 4)


l = int(input())
m = int(input())
n = int(input())
print(7 * min(l, m // 2, n // 4))


import sys
import math
import bisect

def main():
	A = []
	for i in range(3):
		A.append(int(input()))
	B = [0] * 3
	B[0] = A[0] // 1
	B[1] = A[1] // 2
	B[2] = A[2] // 4
	print(min(B) * 7)
main()


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


line = [int(input()), int(input()), int(input())]
print(min(line[0] * 4, line[1] * 2, line[2]) // 4 * 7)


import math
x = input()
x = int(x)
y = input()
y = int(y)
z = input()
z = int(z)
m = min(x, min(math.floor(y / 2), math.floor(z / 4)))
print(7 * m)


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


x = int(input())
y = int(input())
z = int(input())
count = 0
if x < 1 and y < 2 and (z < 4):
	print(0)
else:
	i = 0
	while i < 1006:
		if x >= 1 and y >= 2 and (z >= 4):
			count += 1 + 2 + 4
			x -= 1
			y -= 2
			z -= 4
		i += 1
print(count)


from sys import stdin, stdout
intn = lambda : int(stdin.readline())
strs = lambda : stdin.readline()[:-1]
lstr = lambda : list(stdin.readline()[:-1])
mint = lambda : map(int, stdin.readline().split())
lint = lambda : list(map(int, stdin.readline().split()))
out = lambda x: stdout.write(str(x) + '\n')
out_ = lambda x: stdout.write(str(x) + ' ')

def main():
	a = intn()
	b = intn() // 2
	c = intn() // 4
	y = min(a, b, c)
	if y == 0:
		out(0)
	else:
		out(y * 7)
main()


n = int(input())
m = int(input()) // 2
v = int(input()) // 4
print(min(n, m, v) * 7)


lemons = int(input())
apples = int(input())
pears = int(input())
p_legit = pears - pears % 4
a_legit = min(apples - apples % 2, p_legit // 2)
l_legit = min(lemons, a_legit // 2)
a_legit = l_legit * 2
p_legit = a_legit * 2
print(a_legit + p_legit + l_legit)


import math
L = lambda : list(map(int, input().split()))
M = lambda : map(int, input().split())
I = lambda : int(input())
a = I()
b = I()
c = I()
for i in range(a, 0, -1):
	if 2 * i <= b and 4 * i <= c:
		print(i * 7)
		exit()
print(0)


a = int(input())
b = int(input()) // 2
c = int(input()) // 4
minimum = min(a, b, c)
total = minimum + minimum * 2 + minimum * 4
print(total)


a = eval(input())
b = eval(input())
c = eval(input())
k = 0
while a > 0 and b > 0 and (c > 0):
	if a >= 1 and b >= 2 and (c >= 4):
		k += 1
	a -= 1
	b -= 2
	c -= 4
print(k * 7)


l = int(input())
a = int(input())
p = int(input())
a = a // 2
p = p // 4
h = min(l, a, p)
print(h * 7)


a = int(input())
b = int(input())
c = int(input())
s = 0
while True:
	a = a - 1
	b = b - 2
	c = c - 4
	if a < 0 or b < 0 or c < 0:
		print(s)
		break
	s += 7


a = int(input())
b = int(input())
c = int(input())
f = 1
while f == 1 and a > 0:
	if a * 2 <= b and a * 2 * 2 <= c:
		print(a * 7)
		f = 0
	else:
		a = a - 1
if f == 1:
	print(0)


q = lambda : map(int, input().split())
qi = lambda : int(input())
qs = lambda : input().split()
a = []
for i in range(3):
	a.append(qi() // 2 ** i)
print(7 * min(a))


l = int(input())
a = int(input())
p = int(input())
x = a // 2
y = p // 4
m = min(l, x, y)
print(m + m * 2 + m * 4)


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


a = int(input())
b = int(input())
c = int(input())
r = 1e+19
r = min(r, a // 1)
r = min(r, b // 2)
r = min(r, c // 4)
sn = r * 7
print(sn)


lemons = int(input())
apples = int(input())
pears = int(input())
result = 0
while lemons >= 1 and apples >= 2 and (pears >= 4):
	lemons = lemons - 1
	apples = apples - 2
	pears = pears - 4
	result = result + 7
print(result)


A = int(input())
B = int(input())
C = int(input())
total = 0
while A >= 1 and B >= 2 and (C >= 4):
	A -= 1
	B -= 2
	C -= 4
	total += 7
print(total)