A strange grid has been recovered from an old book. It has $5$ columns and infinite number of rows. The bottom row is considered as the first row. First few rows of the grid are like this:

..............

..............

20 22 24 26 28

11 13 15 17 19

10 12 14 16 18

 1  3  5  7  9

 0  2  4  6  8

The grid grows upwards forever!

Your task is to find the integer in $\textbf{C}$^{th} column in $\textbf{r}$^{th} row of the grid.

Input Format

There will be two integers r and c separated by a single space.  

Constraints  

$1\leq r\leq2*10^9$

$1\leq c\leq5$

Rows are indexed from bottom to top and columns are indexed from left to right.  

Output Format

Output the answer in a single line.

Sample Input
6 3

Sample Output
25

Explanation

The number in the 6^{th} row and 3^{rd} column is 25.

Difficulty: EASY

Solutions:
nums = input()
nums = nums.split()
row = int(nums[0]) - 1
col = int(nums[1]) - 1
tens = int(row / 2) * 10
ones = row % 2 + col * 2
total = tens + ones
print(total)


(r, c) = map(int, input().split())
r -= 1
c -= 1
print(2 * c + 10 * (r // 2) + r % 2)


import math

def strange_grid(ln):
	nums = list(ln)
	ans = 0
	row = nums[0]
	col = nums[1] - 1
	if row % 2 != 0:
		ans += col * 2
	else:
		ans += col * 2 + 1
	ans += (math.ceil(row / 2) - 1) * 10
	return ans
ln = map(int, input().strip().split(' '))
print(strange_grid(ln))


location = [int(i) for i in str.split(input())]
(r, c) = (location[0], location[1])
if r % 2 == 1:
	print((r - 1) // 2 * 10 + (c - 1) * 2)
else:
	print((r - 1) // 2 * 10 + c * 2 - 1)


n = str(input())
[x, y] = list(map(int, list(n.split())))
x -= 1
y -= 1
row = int(x / 2) * 10
if x % 2 != 0:
	row += 1
print(row + y * 2)


(a, b) = input().split(' ')
a = int(a)
b = int(b)
if a % 2 == 0:
	number = (a - 2) * 5 + 1 + (b - 1) * 2
else:
	number = (a - 1) * 5 + (b - 1) * 2
print(number)


s = str(input()).split()
r = int(s[0])
c = int(s[1])
n = 5 * r
cnt = 0
if r % 2 == 1:
	an = 5 * r
	for i in range(int(5 * r - 5), int(an + 5)):
		if i % 2 == 0:
			cnt = cnt + 1
			if cnt == c:
				print(i)
if r % 2 == 0:
	for i in range(int(5 * r - 10), int(5 * r)):
		if i % 2 == 1:
			cnt = cnt + 1
			if cnt == c:
				print(i)


(a, b) = map(int, input().split(' '))
if a % 2 == 0:
	print(10 * (a // 2 - 1) + (2 * b - 1))
else:
	print(10 * (a // 2) + 2 * b - 2)


(r, c) = (int(x) for x in input().split())
first_in_row = ((r + 1) // 2 - 1) * 10 + (r - 1) % 2
num = first_in_row + (c - 1) * 2
print(num)


(r, c) = list(map(int, input().split()))
r -= 1
c -= 1
if r % 2 == 0:
	print((r // 2 * 5 + c) * 2)
else:
	print(((r - 1) // 2 * 5 + c) * 2 + 1)


import math

def strangeGrid():
	(r, c) = map(int, input().split())
	(a, b) = (0, 0)
	if r % 2 == 0:
		if c == 1:
			b = 1
		elif c == 2:
			b = 3
		elif c == 3:
			b = 5
		elif c == 4:
			b = 7
		elif c == 5:
			b = 9
	elif c == 1:
		b = 0
	elif c == 2:
		b = 2
	elif c == 3:
		b = 4
	elif c == 4:
		b = 6
	elif c == 5:
		b = 8
	print(10 * (math.ceil(r / 2.0) - 1) + b)
strangeGrid()


def strangeGrid(row, col):
	result = 0
	row = row - 1
	col = col - 1
	odd_row = row % 2
	row_num = int(row / 2)
	result = row_num * 10 + col * 2
	if odd_row == 1:
		result = result + 1
	return result
(Row, Col) = map(int, input().strip().split(' '))
print(strangeGrid(Row, Col))


(r, c) = map(int, input().split())
n1 = (r - 1) // 2 + (r - 1) % 2
v = (c - 1) * 2 + n1 + (r - 1 - n1) * 9
print(v)


import sys
a = sys.stdin.readline()
b = a.split()
(r, c) = map(int, b)
firstdigit = (c - 1) * 2 + (r + 1) % 2
seconddigit = (r - 1) // 2 * 10
print(str(firstdigit + seconddigit))


NUMCOLS = 5

def strangegrid(row, column):
	answer = 0
	if row % 2 == 1:
		answer = (row - 1) * NUMCOLS + 2 * (column - 1)
	else:
		answer = (row - 2) * NUMCOLS + 2 * column - 1
	return answer

def main():
	(row, column) = input().strip().split()
	(row, column) = (int(row), int(column))
	assert column <= 5
	answer = strangegrid(row, column)
	print(answer)
main()


import math
(r, c) = list(map(int, input().split()))
r -= 1
print((r >> 1) * 10 + r % 2 + (c - 1 << 1))


(r, c) = [int(i) for i in input().split()]
if r % 2 != 0:
	temp = r // 2 * 10
	temp += 2 * (c - 1)
else:
	temp = 1 + (r // 2 - 1) * 10
	temp += 2 * (c - 1)
print(temp)


(row, col) = map(int, input().split())
if row % 2 == 0:
	first_ele = 5 * row - 9
else:
	first_ele = 5 * (row - 1)
print(first_ele + 2 * (col - 1))


(r, c) = map(int, input().split())
single = 2 * c - 2 + (r - 1) % 2
higher = 10 * int((r - 1) / 2)
print(higher + single)


l = input().strip().split()
s = list(map(int, l))
r = s[0] - 1
c = s[1] - 1
n = r // 2
i = r % 2
ans = i + 2 * c + n * 10
print(ans)


(c, r) = map(int, input().split())
x = int((c - 1) / 2) * 10 + r * 2 - 1
if c % 2 == 0:
	print(x)
else:
	print(x - 1)


(x, y) = [int(a) for a in input().split()]
if x % 2 != 0:
	ans = 0
else:
	ans = 1
ans += 10 * ((x - 1) // 2)
ans += 2 * (y - 1)
print(ans)


(r, c) = tuple(map(int, input().split()))
r -= 1
row_start = 0
if r % 2 == 1:
	row_start = (r - 1) * 5 + 1
else:
	row_start = r * 5
print(row_start + (c - 1) * 2)


def f(r, c):
	if r % 2 == 0:
		return (r - 2) * 5 + 2 * (c - 1) + 1
	else:
		return (r - 1) * 5 + 2 * (c - 1)
(r, c) = input().split()
print(f(int(r), int(c)))


input_string = input()
(r_val, c_val) = input_string.split(' ')
r = int(r_val) - 1
c = int(c_val) - 1
result = 0
if r > 0 and r % 2 == 1:
	result = (r - 1) / 2 * 10 + 1 + c * 2
else:
	result = r / 2 * 10 + c * 2
print(int(result))


line = input().split()
a = int(line[0])
b = (int(line[1]) - 1) * 2
if a % 2 == 0:
	b += 1
a = (a - 1) // 2
print(a * 10 + b)


line = input()
val = [int(i) for i in line.split()]
tens = (val[0] - 1) // 2
if val[0] % 2 == 0:
	units = 2 * val[1] - 1
else:
	units = 2 * (val[1] - 1)
s = 10 * tens + units
print(s)


(r, c) = map(int, input().split())
if r % 2 == 0:
	print((r - 1) // 2 * 10 + (c * 2 - 1))
else:
	print(r // 2 * 10 + (c - 1) * 2)


a = input()
(r, c) = a.split()
(r, c) = (int(r), int(c))
if r % 2 == 0:
	f = (r // 2 - 1) * 10 + 1
	print(f + (c - 1) * 2)
elif r == 1:
	f = 0
	print(f + (c - 1) * 2)
else:
	f = r // 2 * 10
	print(f + (c - 1) * 2)


st = input().split()
r = int(st[0])
c = int(st[1])
if r % 2 == 0:
	print(str(int(r / 2 - 1)).lstrip('0') + str(2 * c - 1))
else:
	print(str(int(r / 2 - 0.5)).lstrip('0') + str(2 * (c - 1)))


import io
import sys
str1 = input()
(r, c) = str1.split()
r = int(r)
c = int(c)
if r % 2 == 0:
	x = c + (r // 2 - 1) * 5
	print(2 * x - 1)
if r % 2 == 1:
	x = c + r // 2 * 5
	print(2 * x - 2)


(r, c) = list(map(int, input().split()))
if r % 2 == 1:
	print(10 * ((r - 1) // 2) + 2 * (c - 1))
else:
	print(10 * ((r - 1) // 2) + 1 + 2 * (c - 1))


import math
(r, c) = input().split(' ')
r = int(r)
c = int(c)
lev = int(r / 2)
start = lev * 10 - 10
if r % 2 == 0:
	start += 1
	rem = 2 * (c - 1)
	print(int(start + rem))
else:
	start += 10
	rem = 2 * (c - 1)
	print(int(start + rem))


(r, c) = map(int, input().split())
r -= 1
c -= 1
n = r // 2 * 10 + r % 2 + c * 2
print(n)


(r, c) = map(int, input().split())
i = 0
val = i + int((r - 1) / 2) * 10 + 2 * (c - 1) + (r + 1) % 2
print('%d' % val)


(row, col) = input().split()
if int(row) % 2 == 0:
	total_1 = int(row) * 5 - 1
elif int(row) % 2 != 0:
	total_1 = (int(row) + 1) * 5 - 2
total_2 = (5 - int(col)) * 2
final = total_1 - total_2
print(final)


numin = input()
inl = numin.split(' ')
row = int(inl[0])
column = int(inl[1])
ans = int((row - 1) / 2) * 10 + 2 * (column - 1)
if row % 2 == 0:
	ans += 1
print(ans)


from sys import stdin
(r, c) = map(int, stdin.readline().strip().split())
r -= 1
c -= 1
base = r // 2
print(base * 10 + c * 2 + r % 2)


(c, r) = input().split()
(c, r) = (int(c), int(r))
val = 0
if c % 2 == 1:
	actual_col = int(c / 2) + 1
	val = (actual_col - 1) * 10 + (r - 1) * 2
else:
	actual_col = int(c / 2)
	val = 1 + (actual_col - 1) * 10 + (r - 1) * 2
print(val)


string = input().strip().split()
r = int(string[0])
c = int(string[1])
value = (r - 1) // 2 * 10 + (r - 1) % 2 + (c - 1) * 2
print(int(value))


def create_row(row_number):
	if row_number % 2 == 0:
		start = row_number * 5
		return [i for i in range(start, start + 9) if i % 2 == 0]
	else:
		start = row_number * 5 - 4
		return [i for i in range(start, start + 9) if i % 2 != 0]
(row, column) = [int(i) - 1 for i in input().split()]
print(create_row(row)[column])


(r, c) = input().split()
R = int(r)
C = int(c)
if R % 2 == 0:
	R_n = (R - 1) // 2 * 10 + 1
else:
	R_n = R // 2 * 10
C_n = C - 1
answer = R_n + C_n * 2
print(answer)


(a, b) = input().split()
(a, b) = (int(a), int(b))
a = a - 1
if a % 2 != 0:
	i0a = (a - 1) / 2 * 10 + 1
else:
	i0a = a / 2 * 10
el = i0a + 2 * (b - 1)
print(int(el))


def getVal(x, y):
	return int(int(x) // 2 * 10 + x % 2 + y * 2)
(r, c) = list(map(int, input().split(' ')))
print(getVal(r - 1, c - 1))


(r, c) = map(int, input().split())
print((r - 1) // 2 * 10 + 2 * (c - 1) + (r - 1) % 2)


(row, col) = [int(i) for i in input().split()]
X = (row - 1) // 2 * 10
if row % 2:
	X += (col - 1) * 2
else:
	X += col * 2 - 1
print(X)


(r, c) = [int(ns) for ns in str(input()).split()]
print((c - 1) * 2 + (r + 1) % 2 + int((r - 1) / 2) * 10)


(r, c) = [int(x) for x in input().strip().split(' ')]
if r % 2 == 0:
	base = 1 + 2 * (c - 1)
else:
	base = 2 * (c - 1)
print(base + 10 * ((r - 1) // 2))


(row, col) = [int(s) for s in input().split()]
print((row - 1) // 2 * 10 + (row - 1) % 2 + (col - 1) * 2)


(r, c) = [int(x) - 1 for x in input().split()]
print(r // 2 * 10 + r % 2 + 2 * c)


a = []
r = 0
c = 0
ans = 0
(r, c) = map(int, input().split())
if r % 2 != 0:
	ans = (r - 1) * 5 + 2 * (c - 1)
else:
	ans = (r - 2) * 5 + 2 * c - 1
print(ans)


str1 = str(input())
alist = str1.split(' ')
r = int(alist[0])
c = int(alist[1])
if r % 2 == 1:
	r = (r - 1) * 5 + (c - 1) * 2
else:
	r = (r - 2) * 5 + (c - 1) * 2 + 1
print(r)


import fileinput
import sys
import math
firstrow = [0, 2, 4, 6, 8]
secondrow = [1, 3, 5, 7, 9]
for line in fileinput.input():
	data = line.split()
	row = int(data[0])
	column = int(data[1])
if row > 2:
	prefix = math.ceil((row - 2) / 2) * 10
else:
	prefix = 0
firstOrSecondCol = row % 2
if firstOrSecondCol == 1:
	print(prefix + firstrow[column - 1])
else:
	print(prefix + secondrow[column - 1])


(r, c) = map(int, input().split())
if r % 2:
	print(10 * (r // 2) + 2 * (c - 1))
else:
	print(10 * (r // 2 - 1) + 2 * c - 1)


import sys, math
(r, c) = map(int, sys.stdin.readline().split())
if c >= 1 and c <= 5:
	if r >= 1:
		dict1 = {1: 0, 2: 2, 3: 4, 4: 6, 5: 8}
		k = dict1[c]
		if r % 2 == 0:
			p = r / 2
			k = k + 10 * (p - 1) + 1
			print(int(k))
		else:
			p = int(r / 2)
			k = k + 10 * p
			print(int(k))


(row, column) = map(int, input().split())
start = (row - 1) // 2 * 10
if row % 2 == 0:
	start += 1
diff = (column - 1) * 2
print(start + diff)


(row, col) = map(int, input().split())
row -= 1
col -= 1
print(row // 2 * 10 + col * 2 + (1 if row % 2 == 1 else 0))


(r, c) = input().split()
c = int(c)
r = int(r)
ans = ((r + 1) // 2 - 1) * 10 + (2 * c - 1) - 1
if r % 2 == 0:
	ans += 1
print(ans)


[r, c] = [int(x) for x in input().split()]
number = 10 * ((r - 1) // 2) + ((c - 1) * 2 + (r - 1) % 2)
print(number)


(r, c) = map(int, input().split())
wholeR = (r - 1) // 2
remainR = (r - 1) % 2
ans = 10 * wholeR
num = [1, 3, 5, 7, 9, 2, 4, 6, 8, 10]
remain = num[remainR * 5 + c - 1] - 1
ans += remain
print(ans)


(r, c) = input().split()
(r, c) = (int(r), int(c))
print(10 * ((r + 1) // 2 - 1) + 2 * (c - 1) + (r + 1) % 2)


def get_row(r):
	d = 1 if r % 2 == 0 else 0
	t = (r + 1) // 2 - 1
	f = lambda x: x + 10 * t + d
	return [f(x) for x in range(0, 9, 2)]
(r, c) = [int(x) for x in input().strip().split()]
print(get_row(r)[c - 1])


a = [-1, 0, 2, 4, 6, 8]
inp = input().split(' ')
r = int(inp[0])
c = int(inp[1])
if r % 2 == 0:
	cal = (r - 2) * 5 + a[c] + 1
else:
	cal = (r - 1) * 5 + a[c]
print(cal)


(r, c) = map(int, input().split())
if r % 2 == 0:
	result = 1
else:
	result = 0
result += 2 * (c - 1)
result += 10 * ((r - 1) // 2)
print(result)


(r, c) = map(int, input().split(' '))
print(int((r - 1) / 2) * 10 + (r - 1) % 2 + (c - 1) * 2)


(x, y) = [int(i) for i in input().split()]
print((x - 1) // 2 * 10 + (x - 1) % 2 + (y - 1) * 2)


import sys
lines = [int(l) for l in sys.stdin.readline().split()]
r = lines[0]
c = lines[1]
ones = 2 * (c - 1) + (r - 1) % 2
tens = (r - 1) // 2 * 10
print(tens + ones)


import math
(r, c) = map(int, input().split())
is_odd = r % 2 == 0
group = int(math.ceil(r / 2)) - 1
result = group * 10 + 2 * (c - 1)
if is_odd:
	result += 1
print(result)


(r, c) = input().split(' ')
r = int(r)
c = int(c)
if r % 2 != 0:
	print((r - 1) * 5 + (c - 1) * 2)
else:
	print((r - 2) * 5 + 1 + (c - 1) * 2)


(a, b) = map(int, input().split())
tens = (a - 1) // 2
if a % 2 == 1:
	no = 2 * (b - 1)
else:
	no = 2 * (b - 1) + 1
print(tens * 10 + no)


(r, c) = [int(i) for i in input().split(' ')]
print((r - 1) // 2 * 10 + (c - 1) * 2 + (1 if r % 2 == 0 else 0))


(r, c) = input().split()
(r, c) = (int(r), int(c))
num = 5 * (r - 1) + c
grid = [0, 2, 4, 6, 8, 1, 3, 5, 7, 9]
if r == 1 or r == 2:
	ans = grid[num - 1]
	print(ans)
elif r % 2 == 1:
	ans = (r - 1) // 2 * 10 - 1 + (2 * c - 1)
	print(ans)
else:
	ans = (r - 2) // 2 * 10 - 1 + 2 * c
	print(ans)


str = input()
str = str.split(' ')
row = int(str[0])
column = int(str[1])
num = 0
if row % 2 != 0:
	num = int(row / 2) * 10 + int(column - 1) * 2
else:
	num = (int(row / 2) - 1) * 10 + int(column - 1) * 2 + 1
print(num)


import math
(j, i) = map(int, input().split(' '))
print(10 * math.floor((j - 1) / 2) + (2 * i - 2 if j & 1 == 1 else 2 * i - 1))


paras = [int(i) - 1 for i in input().strip().split(' ')]
print(paras[1] * 2 + paras[0] % 2 + 10 * (paras[0] // 2))


line1 = input().split()
r = int(line1[0])
c = int(line1[1])
start = 0
start += (c - 1) * 2
start += r // 2
start += 9 * ((r - 1) // 2)
print(start)


(r, c) = input().split(' ')
(r, c) = (int(r), int(c))
r = r - 1
(s, res) = (0, 0)
if r % 2 == 0:
	s = r * 5
else:
	s = (r - 1) * 5 + 1
off = (c - 1) * 2
res = s + off
print(res)


(row, col) = [int(x) - 1 for x in input().split()]
num_cols = 5
num = 2 * (row // 2 * num_cols + col)
if row % 2 != 0:
	num += 1
print(num)


import fileinput
import math
lines = fileinput.input()
for line in lines:
	[rowString, colString] = line.split()
	row = int(rowString)
	col = int(colString)
	numbers = list(range(0, 10))
	odds = list(filter(lambda x: x % 2 == 1, numbers))
	evens = list(filter(lambda x: x % 2 == 0, numbers))
	val = 0
	val = (row - 1 >> 1) * 10 + evens[col - 1] if row % 2 == 1 else (row - 2 >> 1) * 10 + odds[col - 1]
	print(val)


from math import floor, ceil
(r, c) = input().split()
c = int(c) - 1
r = int(r) - 1
noOnes = ceil(r / 2)
noNines = floor(r / 2)
print(c * 2 + noOnes + 9 * noNines)


s = input()
r = int(s.split(' ')[0])
c = int(s.split(' ')[1])
r = r - 1
x = int(r / 2)
y = int(r % 2)
result = 0
if c == 1:
	result = x * 9 + x + y * 1
	print(result + 0)
elif c == 2:
	result = x * 9 + x + y * 1
	print(result + 2)
elif c == 3:
	result = x * 9 + x + y * 1
	print(result + 4)
elif c == 4:
	result = x * 9 + x + y * 1
	print(result + 6)
else:
	result = x * 9 + x + y * 1
	print(result + 8)


ni = input().split()
r = int(ni[0])
c = int(ni[1])
di = [1, 3, 5, 7, 9]
dp = [0, 2, 4, 6, 8]
if r % 2 == 0:
	res = (r / 2 - 1) * 10 + di[c - 1]
else:
	res = ((r + 1) / 2 - 1) * 10 + dp[c - 1]
print(int(res))


__author__ = 'danielbaeck'
(r, c) = [int(x) for x in input().split()]
r -= 1
c -= 1
rem = 0
if r % 2:
	rem = 5
print(r * 5 - rem + 2 * c + r % 2)


txt = input().split()
a = int(txt[0])
b = int(txt[1])
if a % 2 == 0:
	arv = (a / 2 - 1) * 10
	arv = arv + 2 * b - 1
	print(int(arv))
else:
	arv = 10 * (a - 1) / 2
	arv = arv + 2 * b - 2
	print(int(arv))


from math import floor, ceil
(r, c) = [int(i) - 1 for i in input().split()]
print(10 * floor(r / 2) + (1 if r % 2 == 1 else 0) + 2 * c)


(r, c) = map(int, input().split())
if r % 2 != 0:
	print((r - 1) * 5 + (c - 1) * 2)
else:
	print((r - 2) * 5 + (c - 1) * 2 + 1)


def strange_grid():
	(r, c) = map(int, input().split())
	if not r % 2:
		result = (r - 2) * 5 + 2 * c - 1
	else:
		result = (r - 1) * 5 + (c - 1) * 2
	print(result)
strange_grid()


(R, C) = (int(x) for x in input().split())
if R % 2 == 0:
	print((R - 2) * 5 + 1 + (C - 1) * 2)
else:
	print((R - 1) * 5 + (C - 1) * 2)


def make_row(n_r):
	r_n = []
	n = int(n_r / 2)
	for i in range(0, 5):
		if n_r % 2 == 0:
			r_n.append(n * 10 + 2 * i)
		else:
			r_n.append(n * 10 + 1 + 2 * i)
	return r_n
inp = input()
inp_l = inp.split()
r = int(inp_l[0])
c = int(inp_l[1])
rn = make_row(r - 1)
print(rn[c - 1])


(r, c) = map(int, input().split())
result = 10 * ((r + 1) // 2 - 1) + (c - 1) * 2
if r % 2 == 0:
	result += 1
print(result)


(a, b) = input().split()
a = int(a)
b = int(b)
if a % 2 == 0:
	ans = 10 * (int(a / 2) - 1) + (2 * b - 1)
else:
	ans = 10 * int((a - 1) / 2) + (2 * b - 2)
print(ans)


numbers = input()
numbers2 = numbers.split(' ', 2)
row = int(numbers2[0])
column = int(numbers2[1])
tens = int((row - 1) / 2)
answer = tens * 10 + (column - 1) * 2 + 1 - 1 * row % 2
print(answer)


(r, c) = input().split()
(r, c) = (int(r), int(c))
ans = (r - 1) // 2 * 10 + (c - 1) * 2 + (r + 1) % 2
print(ans)


(r, c) = list(map(int, input().split(' ')))
r -= 1
c -= 1
if r % 2 == 0:
	print(r // 2 * 10 + c * 2)
else:
	print(r // 2 * 10 + 1 + c * 2)


(rowPick, colPick) = input().split()
(rowPick, colPick) = (int(rowPick), int(colPick))
if rowPick % 2 == 1:
	rowStart = rowPick * 5 - 5
else:
	rowStart = (rowPick - 1) * 5 - 4
colAdder = (colPick - 1) * 2
answer = rowStart + colAdder
print(answer)


(r, c) = map(int, input().split())
print((r - 1) // 2 * 10 + (c - 1) * 2 + (r - 1) % 2)


(row, column) = [int(x) for x in input().split()]
row -= 1
groupOf10 = row // 2
startPoint = groupOf10 * 10
print(startPoint + row % 2 + 2 * (column - 1))


def main():
	(r, c) = map(int, input().split())
	print((r - 1) // 2 * 10 + (r - 1) % 2 + (c - 1) * 2)
main()


(r, c) = input().split()
r = int(r)
c = int(c)
res = 0 + (c - 1) * 2
if r % 2 == 0:
	res += 1
if (r / 2).is_integer():
	res += 10 * int(r / 2 - 1)
else:
	res += 10 * int(r / 2)
print(int(res))


RC = list(map(int, input().split()))
r = RC[0] - 1
c = RC[1] - 1
print(int(r / 2) * 10 + r % 2 + c * 2)