After finishing eating her bun, Alyona came up with two integers n and m. She decided to write down two columns of integers — the first column containing integers from 1 to n and the second containing integers from 1 to m. Now the girl wants to count how many pairs of integers she can choose, one from the first column and the other from the second column, such that their sum is divisible by 5.

Formally, Alyona wants to count the number of pairs of integers (x, y) such that 1 ≤ x ≤ n, 1 ≤ y ≤ m and $(x + y) \operatorname{mod} 5$ equals 0.

As usual, Alyona has some troubles and asks you to help.


-----Input-----

The only line of the input contains two integers n and m (1 ≤ n, m ≤ 1 000 000).


-----Output-----

Print the only integer — the number of pairs of integers (x, y) such that 1 ≤ x ≤ n, 1 ≤ y ≤ m and (x + y) is divisible by 5.


-----Examples-----
Input
6 12

Output
14

Input
11 14

Output
31

Input
1 5

Output
1

Input
3 8

Output
5

Input
5 7

Output
7

Input
21 21

Output
88



-----Note-----

Following pairs are suitable in the first sample case:   for x = 1 fits y equal to 4 or 9;  for x = 2 fits y equal to 3 or 8;  for x = 3 fits y equal to 2, 7 or 12;  for x = 4 fits y equal to 1, 6 or 11;  for x = 5 fits y equal to 5 or 10;  for x = 6 fits y equal to 4 or 9. 

Only the pair (1, 4) is suitable in the third sample case.

Source: codeforces | Difficulty: EASY
Tags: Number theory

Mathematics

Constructive algorithms


Solutions:
(n, k) = map(int, input().rstrip().split(' '))
m = max(n, k)
n = min(n, k)
total = m * (n // 5)
z = n % 5 + m % 5
f = 0
if z > 5:
	f = z % 5
else:
	f = 0
total = total + n % 5 * (m // 5) + z // 5 + f
print(total)


import math
(n, m) = map(int, input().split())
ndiv = math.floor(n / 5)
nmod = n % 5
mdiv = math.floor(m / 5)
mmod = m % 5
mods = 0
if nmod + mmod >= 5:
	mods = nmod + mmod - 4
ans = ndiv * mdiv * 5 + nmod * mdiv + mmod * ndiv + mods
print(ans)


s1 = input()
L = s1.split()
(n, m) = (int(L[0]), int(L[1]))
v1 = [[], [], [], [], []]
v2 = [[], [], [], [], []]
for i in range(1, n + 1):
	v1[i % 5].append(i)
for i in range(1, m + 1):
	v2[i % 5].append(i)
ans = 0
for i in range(5):
	ans += len(v1[i]) * len(v2[(5 - i) % 5])
print(ans)


(n, m) = [int(x) for x in input().split()]
res = 0
tmp1 = []
tmp2 = []
for i in range(1, 6):
	if n >= i:
		tmp1.append(int((n - i) / 5) + 1)
	else:
		tmp1.append(0)
	if m >= i:
		tmp2.append(int((m - i) / 5) + 1)
	else:
		tmp2.append(0)
for i in range(4):
	res += tmp1[i] * tmp2[3 - i]
res += tmp1[4] * tmp2[4]
print(res)


(a, b) = map(int, input().split())
val = a // 5
an = a % 5
aa = []
for i in range(5):
	aa.append(val + (1 if an >= i + 1 else 0))
val = b // 5
an = b % 5
bb = []
for i in range(5):
	bb.append(val + (1 if an >= i + 1 else 0))
ans = 0
for i in range(4):
	ans += aa[i] * bb[3 - i]
ans += aa[4] * bb[4]
print(ans)


(n, m) = list(map(int, input().split()))
nn = [n // 5] * 5
mm = [m // 5] * 5
bache1 = n // 5 * 5
bache2 = m // 5 * 5
for i in range(bache1 + 1, n + 1):
	nn[i % 5] += 1
for i in range(bache2 + 1, m + 1):
	mm[i % 5] += 1
print(nn[0] * mm[0] + nn[1] * mm[4] + nn[2] * mm[3] + nn[4] * mm[1] + nn[3] * mm[2])


(n, m) = map(int, input().split(' '))
res = 0
print(sum((((i + 1) % 5 + m) // 5 * (n // 5 + 1) for i in range(5) if n % 5 >= i + 1)) + sum((((i + 1) % 5 + m) // 5 * (n // 5) for i in range(5) if n % 5 < i + 1)))


inp = lambda : map(int, input().split())
(al, bl) = inp()
a = [0] * 5
b = [0] * 5
for i in range(1, al + 1):
	a[i % 5] += 1
for i in range(1, bl + 1):
	b[i % 5] += 1
ans = a[0] * b[0] + a[1] * b[4] + a[2] * b[3] + a[3] * b[2] + a[4] * b[1]
print(ans)


(n, m) = map(int, input().split())
ost_in_n = [0] * 5
ost_in_m = [0] * 5
for i in range(5):
	if i == 0:
		ost_in_n[i] = (n - i) // 5
		ost_in_m[i] = (m - i) // 5
	else:
		ost_in_n[i] = (n - i) // 5 + 1
		ost_in_m[i] = (m - i) // 5 + 1
s = 0
for i in range(5):
	s += ost_in_n[i] * ost_in_m[(5 - i) % 5]
print(s)


(a, b) = map(int, input().split())
small = min(a, b)
big = max(a, b)
count = 0
for i in range(1, small + 1):
	count = count + (i + big) // 5 - i // 5
print(f'{count}')


def generateSums(num1, num2):
	a = []
	b = []
	for i in range(5):
		a.append(0)
		b.append(0)
	for i in range(num1 + 1):
		a.append(0)
	for i in range(num2 + 1):
		b.append(0)
	for i in range(1, num1 + 1):
		a[i % 5] += 1
	for i in range(1, num2 + 1):
		b[i % 5] += 1
	return a[0] * b[0] + a[1] * b[4] + a[2] * b[3] + a[3] * b[2] + a[4] * b[1]
nums = input().split()
print(generateSums(int(nums[0]), int(nums[1])))


(n, m) = [int(x) for x in input().split()]
n_rem = [n // 5] * 5
m_rem = [m // 5] * 5
for i in range(n % 5):
	n_rem[(i + 1) % 5] += 1
for i in range(m % 5):
	m_rem[(i + 1) % 5] += 1
print(n_rem[0] * m_rem[0] + n_rem[1] * m_rem[4] + n_rem[2] * m_rem[3] + n_rem[3] * m_rem[2] + n_rem[4] * m_rem[1])


from collections import defaultdict, deque, Counter, OrderedDict

def main():
	(n, m) = map(int, input().split())
	(n1, n2) = divmod(n, 5)
	(m1, m2) = divmod(m, 5)
	ans = n1 * 5 * m1 + m2 * n1 + m1 * n2
	if n2 + m2 >= 5:
		ans += n2 + m2 - 4
	print(ans)

def __starting_point():
	main()
__starting_point()


(a, b) = map(int, input().split())
a1 = [0, 0, 0, 0, 0]
b1 = [0, 0, 0, 0, 0]
if a >= 5:
	a1 = [a // 5, a // 5, a // 5, a // 5, a // 5]
	a %= 5
if b >= 5:
	b1 = [b // 5, b // 5, b // 5, b // 5, b // 5]
	b %= 5
for i in range(1, a + 1):
	if i % 5 == 0:
		a1[0] += 1
	elif i % 5 == 1:
		a1[1] += 1
	elif i % 5 == 2:
		a1[2] += 1
	elif i % 5 == 3:
		a1[3] += 1
	elif i % 5 == 4:
		a1[4] += 1
for i in range(1, b + 1):
	if i % 5 == 0:
		b1[0] += 1
	elif i % 5 == 1:
		b1[1] += 1
	elif i % 5 == 2:
		b1[2] += 1
	elif i % 5 == 3:
		b1[3] += 1
	elif i % 5 == 4:
		b1[4] += 1
print(a1[0] * b1[0] + a1[1] * b1[4] + a1[2] * b1[3] + a1[3] * b1[2] + a1[4] * b1[1])


(n, m) = map(int, input().split())
ans = 5 * (n // 5) * (m // 5)
for i in range(n % 5):
	ans += m // 5
for i in range(m % 5):
	ans += n // 5
(r1, r2) = (n % 5, m % 5)
for i in range(1, r1 + 1):
	if i + r2 >= 5:
		ans += 1
print(ans)


(n, m) = map(int, input().split())
f = 0
for i in range(1, n + 1):
	f += (m + i % 5) // 5
print(f)


(n, m) = list(map(int, input().split()))
ans = 0
for i in range(1, n + 1):
	ans += (m + i % 5) // 5
print(ans)


(n, m) = map(int, input().split())
count = 0
for i in range(1, n + 1):
	diff = 5 - i % 5
	count += (m - diff) // 5 + 1
print(count)


d = lambda a, b: a // 5 * (b // 5)
(n, m) = map(int, input().split())
print(d(n, m) + d(n + 4, m + 1) + d(n + 3, m + 2) + d(n + 2, m + 3) + d(n + 1, m + 4))


(n, m) = map(int, input().split())
count = 0
if n >= m:
	for i in range(1, m + 1):
		count += (n + i) // 5 - i // 5
else:
	for i in range(1, n + 1):
		count += (m + i) // 5 - i // 5
print(count)


(n, m) = map(int, input().split())
s1 = [0, 0, 0, 0, 0]
s2 = [0, 0, 0, 0, 0]
for i in range(1, n + 1):
	s1[i % 5] += 1
for i in range(1, m + 1):
	s2[i % 5] += 1
print(s1[0] * s2[0] + s1[1] * s2[4] + s1[2] * s2[3] + s1[3] * s2[2] + s1[4] * s2[1])


from collections import Counter
(n, m) = list(map(int, input().split()))
k = 5
if n < m:
	(n, m) = (m, n)
am = [i % k for i in range(1, m + 1)]
modk = Counter(am)
ans = 0
for i in range(1, n + 1):
	ans += modk[(k - i % k) % k]
print(ans)


import math

def remainder_error(start, iterations):
	term = int((start + 0.2) / 0.2)
	error = 0
	for i in range(0, iterations):
		if term == 6:
			term = 1
		else:
			error += 0.2 * (term - 1)
		term += 1
	return error
string_input = input().split(' ')
(n, m) = (int(string_input[0]), int(string_input[1]))
right_start = (1 + m) / 5
right_end = (m + n) / 5
right_sum_with_error = round(n * (right_start + right_end) / 2, 1)
left_end = (1 + n) / 5
left_sum_with_error = round(n * (0.4 + left_end) / 2, 1)
right_start_decimal = int(round(right_start, 1) * 10 % 10) / 10
offset = n // 5
offset_error = 2 * offset
mod = n % 5
if mod == 4:
	offset += 1
mod_error_left = round(remainder_error(0.4, mod), 1)
mod_error_right = round(remainder_error(right_start_decimal, mod), 1)
left_sum = round(left_sum_with_error - mod_error_left - offset_error, 1)
right_sum = round(right_sum_with_error - mod_error_right - offset_error, 1)
pairs = int(right_sum - left_sum + offset)
print(pairs)


(n, m) = map(int, input().split())
ans = 0
for i in range(1, n + 1):
	l1 = i % 5
	tp1 = m + l1
	ans += tp1 // 5
print(ans)


(n, m) = map(int, input().split())
nmod = n % 5
ndiv = {k: n // 5 for k in range(5)}
for i in range(nmod):
	ndiv[(i + 1) % 5] += 1
mmod = m % 5
mdiv = {k: m // 5 for k in range(5)}
for i in range(mmod):
	mdiv[(i + 1) % 5] += 1
ans = 0
for i in range(5):
	if i == 0:
		ans += ndiv[i] * mdiv[i]
	else:
		ans += ndiv[i] * mdiv[5 - i]
print(ans)


from sys import stdin, stdout
import sys
INF = 100000000000.0
import math

def get_int():
	return int(stdin.readline().strip())

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

def get_array():
	return list(map(int, stdin.readline().strip().split()))

def get_string():
	return stdin.readline().strip()

def op(c):
	return stdout.write(c)
from collections import defaultdict
d = defaultdict(int)
(n, m) = get_ints()
for i in range(1, m + 1):
	d[i % 5] += 1
ans = 0
for i in range(1, n + 1):
	ans += d[(5 - i % 5) % 5]
print(ans)


import math
(x, y) = map(int, input().split())
low = min(x, y)
high = max(x, y)
res = 0
for i in range(1, low + 1):
	if i % 5 == 0:
		res += (high - (5 - 0)) // 5 + 1
	else:
		h = math.ceil(i / 5) * 5 - i
		res += (high - h) // 5 + 1
print(res)


(n, m) = map(int, input().strip().split())
(gn, gm) = (n // 5, m // 5)
(xn, xm) = (n % 5, m % 5)
count = 0
for i in range(1, xn + 1):
	if 5 - i in [*range(1, xm + 1)]:
		count += 1
print(gn * gm * 5 + gn * xm + gm * xn + count)


(n, m) = map(int, input().split())
qn = n // 5
qm = m // 5
if n % 5 == 0:
	an = [qn] * 5
elif n % 5 == 1:
	an = [qn + 1] + [qn] * 4
elif n % 5 == 2:
	an = [qn + 1] * 2 + [qn] * 3
elif n % 5 == 3:
	an = [qn + 1] * 3 + [qn] * 2
elif n % 5 == 4:
	an = [qn + 1] * 4 + [qn] * 1
if m % 5 == 0:
	am = [qm] * 5
elif m % 5 == 1:
	am = [qm + 1] + [qm] * 4
elif m % 5 == 2:
	am = [qm + 1] * 2 + [qm] * 3
elif m % 5 == 3:
	am = [qm + 1] * 3 + [qm] * 2
elif m % 5 == 4:
	am = [qm + 1] * 4 + [qm] * 1
print(am[0] * an[3] + am[1] * an[2] + am[2] * an[1] + am[3] * an[0] + am[4] * an[4])


I = lambda : map(int, input().split())
(n, m) = I()
(n, m) = (min(n, m), max(m, n))
ans = 0
for i in range(5):
	ans += m // 5 + (m % 5 >= 5 - i)
ans *= n // 5
for i in range(1, n % 5 + 1):
	ans += m // 5 + (m % 5 >= 5 - i)
print(ans)


(n, m) = map(int, input().split())
d = {0: [], 1: [], 2: [], 3: [], 4: []}
for i in range(1, m + 1):
	d[i % 5].append(i)
ans = 0
for i in range(1, n + 1):
	ans += len(d[(5 - i % 5) % 5])
print(ans)


(n, m) = map(int, input().split())
Ln = [(n - x) // 5 + 1 for x in range(6)]
Lm = [(m - x) // 5 + 1 for x in range(6)]
print(Ln[5] * Lm[5] + sum((Ln[i] * Lm[5 - i] for i in range(1, 5))))


a = [int(x) for x in input().split()]
x = a[0]
y = a[1]
p = x * (y // 5)
for i in range(1, x + 1):
	if y % 5 + i % 5 >= 5:
		p += 1
print(p)


(n, m) = map(int, input().split())
q1 = n // 5
q2 = m // 5
res = 5 * q1 * q2
r1 = n % 5
r2 = m % 5
arr1 = [i + 1 for i in range(r1)]
arr2 = [i + 1 for i in range(r2)]
for i in range(r1):
	for j in range(r2):
		if arr1[i] + arr2[j] == 5:
			res += 1
res += q1 * r2
res += q2 * r1
print(res)


(m, n) = map(int, input().split())
A = [0 for x in range(5)]
B = [0 for p in range(5)]
for i in range(1, m + 1):
	A[i % 5] += 1
for i in range(1, n + 1):
	B[i % 5] += 1
print(f'{A[0] * B[0] + A[1] * B[4] + A[2] * B[3] + A[3] * B[2] + A[4] * B[1]}')


import sys

def minp():
	return sys.stdin.readline().strip()

def f(x, k):
	if k == 0:
		return x // 5
	return (x + 5 - k) // 5
(n, m) = map(int, minp().split())
r = 0
for i in range(5):
	r += f(n, i) * f(m, 5 - i)
print(r)


(n, m) = map(int, input().split())
d1 = {'1': n // 5, '2': n // 5, '3': n // 5, '4': n // 5, '0': n // 5}
d2 = {'1': m // 5, '2': m // 5, '3': m // 5, '4': m // 5, '0': m // 5}
for i in range(1, n % 5 + 1):
	d1[str(i)] = d1[str(i)] + 1
for i in range(1, m % 5 + 1):
	d2[str(i)] = d2[str(i)] + 1
print(d1['1'] * d2['4'] + d1['2'] * d2['3'] + d1['3'] * d2['2'] + d1['4'] * d2['1'] + d1['0'] * d2['0'])


(m, n) = [int(x) for x in input().split(' ')]
dm = {}
dn = {}
for i in range(5):
	dm[i] = m // 5 + (m % 5 >= i)
	dn[i] = n // 5 + (n % 5 >= i)
ans = (dm[0] - 1) * (dn[0] - 1)
for i in range(1, 5):
	ans += dm[i] * dn[5 - i]
print(ans)


(n, m) = map(int, input().split())
a = [0] * 6
for i in range(1, n + 1):
	a[i % 5] += 1
a[5] = a[0]
ans = 0
for i in range(1, m + 1):
	ans += a[5 - i % 5]
print(ans)


(n, m) = map(int, input().split())
print(sum(((m + (i + 1) % 5) // 5 for i in range(n))))


[n, m] = list(map(int, input().split()))
res = 0
for x in range(1, n + 1):
	lo = max(1, int((1 + x + 4) / 5))
	hi = int((m + x) / 5)
	res += hi - lo + 1
print(res)


(n, m) = map(int, input().split())
ans = 0
for k in range(1, n + 1):
	ans += (k % 5 + m) // 5
print(ans)


(n, m) = map(int, input().split())
a = [0] * 5
b = [0] * 5
for i in range(1, n + 1):
	a[i % 5] += 1
for i in range(1, m + 1):
	b[i % 5] += 1
print(a[0] * b[0] + a[1] * b[4] + a[2] * b[3] + a[4] * b[1] + a[3] * b[2])


arr = list(map(int, input().split()))
arr1 = [0] * 5
arr2 = [0] * 5
for i in range(5):
	arr1[i] = arr[0] // 5
	arr2[i] = arr[1] // 5
for i in range(0, arr[0] % 5):
	arr1[i] += 1
for i in range(0, arr[1] % 5):
	arr2[i] += 1
ans = 0
for i in range(4):
	ans += arr1[i] * arr2[3 - i]
ans += arr2[4] * arr1[4]
print(ans)


[n, m] = map(int, input().split())
list1 = []
for i in range(2, n + m + 1, 1):
	if i % 5 == 0:
		list1.append(i)
flag = 0
for j in list1:
	if j != n:
		flag += min(n, j - 1) - max(1, j - m) + 1
	else:
		flag += n - 1 - max(1, j - m) + 1
print(flag)


import os
import sys
from io import BytesIO, IOBase
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')
from collections import defaultdict
from math import ceil, floor, sqrt, log2, gcd, pi
from heapq import heappush, heappop
from bisect import bisect_left, bisect
import sys
abc = 'abcdefghijklmnopqrstuvwxyz'
ABC = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
(n, m) = map(int, input().split())
a = [n // 5] * 5
b = [m // 5] * 5
if n % 5 == 1:
	a[1] += 1
elif n % 5 == 2:
	a[1] += 1
	a[2] += 1
elif n % 5 == 3:
	a[1] += 1
	a[2] += 1
	a[3] += 1
elif n % 5 == 4:
	a[1] += 1
	a[2] += 1
	a[3] += 1
	a[4] += 1
if m % 5 == 1:
	b[1] += 1
elif m % 5 == 2:
	b[1] += 1
	b[2] += 1
elif m % 5 == 3:
	b[1] += 1
	b[2] += 1
	b[3] += 1
elif m % 5 == 4:
	b[1] += 1
	b[2] += 1
	b[3] += 1
	b[4] += 1
ans = 0
ans += a[0] * b[0]
ans += a[1] * b[4]
ans += a[2] * b[3]
ans += a[3] * b[2]
ans += a[4] * b[1]
print(ans)


import sys
(n, m) = map(int, sys.stdin.readline().split())
ans = n // 5 * (m // 5)
ans += (n + 4) // 5 * ((m + 1) // 5)
ans += (n + 3) // 5 * ((m + 2) // 5)
ans += (n + 2) // 5 * ((m + 3) // 5)
ans += (n + 1) // 5 * ((m + 4) // 5)
print(ans)


inputz = input().split()
n = max(int(inputz[0]), int(inputz[1]))
m = min(int(inputz[0]), int(inputz[1]))
count = 0
for i in range(1, m + 1):
	count += n // 5
o = n // 5 * 5
p = m // 5 * 5
for i in range(o + 1, o + n % 5 + 1):
	count += m // 5
	for j in range(p + 1, p + m % 5 + 1):
		if not (i + j) % 5:
			count += 1
print(count)


import math
from collections import Counter, defaultdict
I = lambda : int(input())
M = lambda : map(int, input().split())
LI = lambda : list(map(int, input().split()))
(a, b) = M()
c = {}
d = {}
for i in range(1, 6):
	c[i] = a // 5
for i in range(0, a % 5):
	c[i + 1] += 1
for j in range(1, 6):
	d[j] = b // 5
for j in range(0, b % 5):
	d[j + 1] += 1
ans = d[5] * c[5]
for i in range(1, 5):
	ans += c[i] * d[5 - i]
print(ans)


(n, m) = map(int, input().split())
a = 5 * [n // 5]
for i in range(1, n % 5 + 1):
	a[i] += 1
b = 5 * [m // 5]
for i in range(1, m % 5 + 1):
	b[i] += 1
cnt = a[0] * b[0]
for i in range(1, 5):
	cnt += a[i] * b[5 - i]
print(cnt)


(n, m) = map(int, input().split())
first = [0 for i in range(5)]
sec = [0 for i in range(5)]
for i in range(1, m + 1):
	first[i % 5] += 1
for i in range(1, n + 1):
	sec[i % 5] += 1
answer = first[0] * sec[0] + first[1] * sec[4] + first[2] * sec[3] + first[3] * sec[2] + first[4] * sec[1]
print(answer)


(l, r) = map(int, input().split())
a = [0] * 5
b = [0] * 5
for i in range(1, l + 1):
	k = i % 5
	a[k] += 1
for i in range(1, r + 1):
	k = i % 5
	b[k] += 1
ans = 0
for i in range(1, 5):
	ans += a[i] * b[5 - i]
ans += a[0] * b[0]
print(ans)


(n, m) = map(int, input().split())
print(2 * n * (m // 10) + 2 * (m % 10) * (n // 10) + sum([sum([1 if (i + j) % 5 == 0 else 0 for i in range(1, 1 + n % 10)]) for j in range(1, 1 + m % 10)]))


ct = 0
(a, b) = map(int, input().split(' '))
x = [0] * 5
for i in range(1, b + 1):
	x[i % 5] += 1
for i in range(1, a + 1):
	ct += x[(0 - i) % 5]
print(ct)


import math
alph = 'abcdefghijklmnopqrstuvwxyz'
(n, m) = map(int, input().split())
d = []
p = []
E = 0
for i in range(1, 5):
	d.append(n // 5 + int(n % 5 >= i))
	p.append(m // 5 + int(m % 5 >= i))
for i in range(4):
	E += d[i] * p[-i - 1]
E += n // 5 * (m // 5)
print(E)


import math
y = [int(i) for i in input().split()]
n = y[0]
m = y[1]
a = [0, 0, 0, 0, 0]
b = [0, 0, 0, 0, 0]
for i in range(1, n + 1):
	a[i % 5] = a[i % 5] + 1
for j in range(1, m + 1):
	b[j % 5] = b[j % 5] + 1
print(a[0] * b[0] + a[1] * b[4] + a[2] * b[3] + b[2] * a[3] + a[4] * b[1])


(m, n) = map(int, input().split())
k = min(m, n)
x = max(m, n)
s = 0
for i in range(1, k + 1):
	s += (i % 5 + x) // 5
print(s)


(n, m) = map(int, input().split())
cnt = 0
N = 5 * int(100000.0)
for k in range(N):
	c = k * 5
	Max = min(n, c - 1)
	Min = max(1, c - m)
	if Max >= c - m and Min <= c - 1:
		cnt += Max - Min + 1
print(cnt)


n = list(map(int, input().split()))
x = n[0]
y = n[1]
a = [0, 0, 0, 0, 0]
b = [0, 0, 0, 0, 0]
for i in range(1, x + 1):
	a[i % 5] += 1
for i in range(1, y + 1):
	b[i % 5] += 1
print(a[0] * b[0] + a[1] * b[4] + a[2] * b[3] + a[3] * b[2] + a[4] * b[1])


temp = input()
temp = temp.split(' ')
n = int(temp[0])
m = int(temp[1])
sum = n // 5 * (5 * (m // 5))
temp = n % 5 * (m // 5)
sum = sum + temp
temp = m % 5 * (n // 5)
sum = sum + temp
n = n % 5
m = m % 5
for x in range(1, n + 1):
	for y in range(1, m + 1):
		if x + y == 5:
			sum += 1
print(sum)


try:
	while True:
		(n, m) = map(int, input().split())
		a = [0] * 5
		b = [0] * 5
		for i in range(1, n + 1):
			a[i % 5] += 1
		for j in range(1, m + 1):
			b[j % 5] += 1
		print(a[0] * b[0] + a[1] * b[4] + a[2] * b[3] + a[3] * b[2] + a[4] * b[1])
except EOFError:
	pass


import sys
import math
input = sys.stdin.readline
(n, m) = map(int, input().strip().split())
(mod_1, mod_2) = ([0] * 5, [0] * 5)
for i in range(1, n + 1):
	mod_1[i % 5] += 1
for i in range(1, m + 1):
	mod_2[i % 5] += 1
ans = 0
for i in range(0, 5):
	ans += mod_1[i % 5] * mod_2[(5 - i) % 5]
print(ans)


(n, m) = map(int, input().split())
l = [0] * 5
l2 = [0] * 5
for i in range(1, n + 1):
	t = i % 5
	l[t] += 1
for i in range(1, m + 1):
	t = i % 5
	l2[t] += 1
print(l[0] * l2[0] + l[1] * l2[4] + l[2] * l2[3] + l[3] * l2[2] + l[4] * l2[1])


(n, m) = map(int, input().split())
c = 0
x = max(n, m)
mi = min(n, m)
if x >= 5 and mi >= 5:
	ma = x - x % 5
	x5 = (ma - 5) // 5 + 1
	x4 = (ma - 4 - 1) // 5 + 1
	x3 = (ma - 3 - 2) // 5 + 1
	x2 = (ma - 2 - 3) // 5 + 1
	x1 = (ma - 1 - 4) // 5 + 1
	if x % 5 == 1:
		x4 = x4 + 1
	elif x % 5 == 2:
		x4 = x4 + 1
		x3 = x3 + 1
	elif x % 5 == 3:
		x4 = x4 + 1
		x3 = x3 + 1
		x2 = x2 + 1
	elif x % 5 == 4:
		x4 = x4 + 1
		x3 = x3 + 1
		x2 = x2 + 1
		x1 = x1 + 1
	s = x1 + x2 + x3 + x4 + x5
	y = s * (mi // 5)
	if mi % 5 == 0:
		print(s * (mi // 5))
	elif mi % 5 == 1:
		print(y + x1)
	elif mi % 5 == 2:
		print(y + x1 + x2)
	elif mi % 5 == 3:
		print(y + x1 + x2 + x3)
	elif mi % 5 == 4:
		print(y + x1 + x2 + x3 + x4)
else:
	for i in range(1, n + 1):
		for j in range(1, m + 1):
			if (i + j) % 5 == 0:
				c += 1
	print(c)


def main():
	(n, m) = map(int, input().split())
	(a, b) = ([n // 5] * 4, [m // 5] * 4)
	for i in range(n % 5):
		a[i] += 1
	for i in range(m % 5):
		b[i] += 1
	res = 0
	for i in range(4):
		res += a[i] * b[3 - i]
	extra = n // 5 * (m // 5)
	print(res + extra)
main()


(n, m) = map(int, input().split())
t = 0
for x in range(1, n + 1):
	x = x % 5
	t += (m + x) // 5
print(t)


inp = input().split()
n = int(inp[0])
m = int(inp[1])
d = {}
A = min(n, m)
B = max(n, m)
for i in range(1, A + 1):
	num = i % 5
	if num == 0:
		num = 5
	if num not in d:
		d[num] = 1
	else:
		d[num] = d.get(num) + 1
count = 0
for i in range(1, B + 1):
	num2 = i % 5
	sol = 5 - num2
	if sol in d:
		count += d.get(sol)
print(count)


(n, m) = map(int, input().split())
N = int(n / 10)
M = int(m / 10)
c = 0
for i in range(10 * N + 1, n + 1):
	for j in range(10 * M + 1, m + 1):
		if (i + j) % 5 == 0:
			c += 1
print(n * 2 * M + N * 2 * (m - 10 * M) + c)


(n, m) = [int(p) for p in input().split()]
count = 0
r = min(n, m)
l = max(n, m)
for i in range(1, r + 1):
	count += (l + i) // 5 - i // 5
print(count)


(n, m) = list(map(int, input().split()))
r = 0
for i in range(1, n + 1):
	x = (5 - i) % 5
	if x == 0:
		r += (m - x) // 5
	else:
		r += (m - x) // 5 + 1
print(r)


(a, b) = map(int, input().split())
(x, y) = (a // 5, b // 5)
cnt = 0
for i in range(1, a % 5 + 1):
	for j in range(1, b % 5 + 1):
		if (i + j) % 5 == 0:
			cnt += 1
print(cnt + x * y * 5 + a % 5 * y + b % 5 * x)


(a, b) = map(int, input().split())
e = 1
sum1 = 0
sum2 = 0
sum3 = 0
sum4 = 0
sum5 = 0
keber = 0
while e <= b:
	if e % 5 == 4:
		sum1 += 1
	elif e % 5 == 3:
		sum2 += 1
	elif e % 5 == 2:
		sum3 += 1
	elif e % 5 == 1:
		sum4 += 1
	elif e % 5 == 0:
		sum5 += 1
	e += 1
keber += int(a / 5) * (sum1 + sum2 + sum3 + sum4 + sum5)
if a % 5 == 0:
	print(keber)
elif a % 5 == 1:
	print(keber + sum1)
elif a % 5 == 2:
	print(keber + sum1 + sum2)
elif a % 5 == 3:
	print(keber + sum1 + sum2 + sum3)
elif a % 5 == 4:
	print(keber + sum1 + sum2 + sum3 + sum4)


(n, m) = map(int, input().split())
p = 0

def cj(_t, _m):
	rem = _t % 5
	_t = int((_t - rem) / 5)
	if _m == 0:
		_t -= 1
	if rem < _m:
		return _t
	return _t + 1
ans = 0
for i in range(5):
	ans += cj(n, i) * cj(m, 5 - i)
print(ans)


def create_div(q, r):
	div = [q] * 5
	for i in range(r):
		div[i] += 1
	return div
(s1, s2) = map(int, input().split())
q1 = s1 // 5
r1 = s1 % 5
q2 = s2 // 5
r2 = s2 % 5
div1 = create_div(q1, r1)
div2 = create_div(q2, r2)
c = div1[-1] * div2[-1]
for i in range(4):
	c += div1[i] * div2[3 - i]
print(c)


(n, m) = map(int, input().split())
k0 = n // 5 * (m // 5)
k1 = (n // 5 + (n % 5 > 0)) * (m // 5 + (m % 5 > 3))
k2 = (n // 5 + (n % 5 > 1)) * (m // 5 + (m % 5 > 2))
k3 = (n // 5 + (n % 5 > 2)) * (m // 5 + (m % 5 > 1))
k4 = (n // 5 + (n % 5 > 3)) * (m // 5 + (m % 5 > 0))
print(k0 + k1 + k2 + k3 + k4)


(n, m) = map(int, input().split())
R = list(range(10))
a = [n // 10 for i in R]
b = [m // 10 for i in R]
for i in R[1:]:
	a[i] += i <= n % 10
	b[i] += i <= m % 10
print(sum((a[i] * b[j] for i in R for j in R if (i + j) % 5 == 0)))


(x, y) = map(int, input().split())
(x, y) = (min(x, y), max(x, y))
ans = 0
for i in range(1, x + 1):
	ans += (y + i) // 5 - i // 5
print(ans)


(a, b) = [int(i) for i in input().split()]
massa = list()
massb = list()
massa.append(int(a / 5))
massa.append(int((a + 1) / 5))
massa.append(int((2 + a) / 5))
massa.append(int((a + 3) / 5))
massa.append(int((a + 4) / 5))
massb.append(int(b / 5))
massb.append(int((b + 1) / 5))
massb.append(int((2 + b) / 5))
massb.append(int((b + 3) / 5))
massb.append(int((b + 4) / 5))
print(massa[0] * massb[0] + massa[1] * massb[4] + massa[2] * massb[3] + massa[3] * massb[2] + massa[4] * massb[1])


num = [int(x) for x in input().split()]
a = {}
b = {}
for i in range(5):
	a[i] = 0
	b[i] = 0
for i in range(1, num[0] + 1):
	if i % 5 in a:
		a[i % 5] += 1
	else:
		a[i % 5] = 1
for i in range(1, num[1] + 1):
	if i % 5 in b:
		b[i % 5] += 1
	else:
		b[i % 5] = 1
sum = a[0] * b[0]
for i in range(1, 5):
	sum += a[i] * b[5 - i]
print(sum)


(n, m) = map(int, input().split())
d = dict()
for i in range(1, n + 1):
	if i % 5 in d:
		d[i % 5] += 1
	else:
		d[i % 5] = 1
sum1 = 0
for i in range(1, m + 1):
	check = i % 5
	if i % 5 == 0 and 0 in d:
		sum1 += d[0]
	elif 5 - check in d:
		sum1 += d[5 - i % 5]
print(sum1)


(a, b) = map(int, input().split())
re = 0
res = 0
for i in range(1, 1 + 5):
	re = (b + i % 5) // 5
	t = (a + (5 - i)) // 5
	res += re * t
print(res)


nm = list(map(int, input().split()))
n = nm[0]
m = nm[1]
answer = 0
dic = {}
if n + m < 5:
	print(0)
else:
	for i in range(1, m + 1):
		if i % 5 not in dic:
			dic[i % 5] = 1
		else:
			dic[i % 5] += 1
	for i in range(1, n + 1):
		x = (5 - i % 5) % 5
		if x in dic:
			answer += dic[x]
	print(answer)


import sys
input = sys.stdin.readline

def ceil(x):
	if x != int(x):
		x = int(x) + 1
	return x

def factorial(x, m):
	val = 1
	while x > 0:
		val = val * x % m
		x -= 1
	return val

def fact(x):
	val = 1
	while x > 0:
		val *= x
		x -= 1
	return val

def swaparr(arr, a, b):
	temp = arr[a]
	arr[a] = arr[b]
	arr[b] = temp

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 nCr(n, k):
	if k > n:
		return 0
	if k > n - k:
		k = n - k
	res = 1
	for i in range(k):
		res = res * (n - i)
		res = res / (i + 1)
	return int(res)

def upper_bound(a, x, lo=0, hi=None):
	if hi == None:
		hi = len(a)
	while lo < hi:
		mid = (lo + hi) // 2
		if a[mid] < x:
			lo = mid + 1
		else:
			hi = mid
	return lo

def primefs(n):
	primes = {}
	while n % 2 == 0 and n > 0:
		primes[2] = primes.get(2, 0) + 1
		n = n // 2
	for i in range(3, int(n ** 0.5) + 2, 2):
		while n % i == 0 and n > 0:
			primes[i] = primes.get(i, 0) + 1
			n = n // i
	if n > 2:
		primes[n] = primes.get(n, 0) + 1
	return primes

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

def swap(a, b):
	temp = a
	a = b
	b = temp
	return (a, b)

def find(x, link):
	p = x
	while p != link[p]:
		p = link[p]
	while x != p:
		nex = link[x]
		link[x] = p
		x = nex
	return p

def union(x, y, link, size):
	x = find(x, link)
	y = find(y, link)
	if size[x] < size[y]:
		(x, y) = swap(x, y)
	if x != y:
		size[x] += size[y]
		link[y] = x

def sieve(n):
	prime = [True for i in range(n + 1)]
	(prime[0], prime[1]) = (False, False)
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p + p, n + 1, p):
				prime[i] = False
		p += 1
	return prime
MAXN = int(100000.0 + 5)

def spf_sieve():
	spf[1] = 1
	for i in range(2, MAXN):
		spf[i] = i
	for i in range(4, MAXN, 2):
		spf[i] = 2
	for i in range(3, ceil(MAXN ** 0.5), 2):
		if spf[i] == i:
			for j in range(i * i, MAXN, i):
				if spf[j] == j:
					spf[j] = i
spf = [0 for i in range(MAXN)]

def factoriazation(x):
	res = []
	for i in range(2, int(x ** 0.5) + 1):
		while x % i == 0:
			res.append(i)
			x //= i
	if x != 1:
		res.append(x)
	return res

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

def float_array():
	return list(map(float, input().strip().split()))

def str_array():
	return input().strip().split()
MOD = int(1000000000.0) + 7
CMOD = 998244353
INF = float('inf')
NINF = -float('inf')
from itertools import permutations
import math
from bisect import bisect_left

def solve():
	(a, b) = map(int, input().split())
	c = 0
	for i in range(1, a + 1):
		c += (i + b) // 5 - i // 5
	print(c)
for _ in range(1):
	solve()


(n, m) = map(int, input().split())
dn = {x: 0 for x in range(5)}
dm = {x: 0 for x in range(5)}
for i in range(1, n + 1):
	dn[i % 5] += 1
for i in range(1, m + 1):
	dm[i % 5] += 1
s = 0
for i in range(1, 5):
	s += dn[i] * dm[5 - i]
s += dn[0] * dm[0]
print(s)


[n, m] = [int(x) for x in input().split()]
a = [n // 5 for i in range(0, 5)]
b = [m // 5 for i in range(0, 5)]
for i in range(1, n % 5 + 1):
	a[i] += 1
for i in range(1, m % 5 + 1):
	b[i] += 1
c = a[0] * b[0]
for i in range(1, 5):
	c += a[i] * b[5 - i]
print(c)


(n, m) = map(int, input().split())
nn = n + (5 - n % 5) % 5
mm = m + (5 - m % 5) % 5
ans = nn * mm // 5 - (mm - m) * nn // 5 - (nn - n) * mm // 5
for i in range(n + 1, nn + 1):
	j = i % 5
	if mm - j > m:
		ans += 1
print(ans)


def f(n, i):
	return n // 5 + (i in range(1, 5) and n % 5 >= i)
(n, m) = map(int, input().split())
print(sum((f(n, i) * f(m, 5 - i) for i in range(5))))


arr = input().split()
m = int(arr[0])
n = int(arr[1])
modm = [m // 5, m // 5, m // 5, m // 5, m // 5]
modm[:m % 5] = [m // 5 + 1 for i in range(m % 5)]
modn = [n // 5, n // 5, n // 5, n // 5, n // 5]
modn[:n % 5] = [n // 5 + 1 for i in range(n % 5)]
print(modm[0] * modn[3] + modm[1] * modn[2] + modm[2] * modn[1] + modm[3] * modn[0] + modm[4] * modn[4])


(n, m) = map(int, input().split(' '))
counter = 0
for i in range(1, m + 1):
	no = i % 5
	counter += (n + i % 5) // 5
print(counter)


(maxN, maxM) = map(int, input().split())
sum = maxN // 5 * (maxM // 5)
if maxM < maxN:
	tmp = maxN
	maxN = maxM
	maxM = tmp
for n in range(1, maxM + 1):
	if n % 5 == 0:
		continue
	m = 5 - n % 5
	sum += (maxN - m) // 5 + 1
print(sum)


(n, m) = map(int, input().split(' '))
result = 0
for i in range(5):
	a = n // 5 + (1 if i != 0 and i <= n % 5 else 0)
	b = m // 5 + (1 if 5 - i <= m % 5 else 0)
	result += a * b
print(result)


(a, b) = map(int, input().split())
(d, p) = ({}, {})
for i in range(1, 6):
	if i <= a % 5:
		d[i] = a // 5 + 1
	else:
		d[i] = a // 5
	if i <= b % 5:
		p[i] = b // 5 + 1
	else:
		p[i] = b // 5
z = d[5] * p[5]
for i in range(1, 5):
	z += d[i] * p[5 - i]
print(z)


(n, m) = map(int, input().split())
res = 0
for k in range(1, 400001):
	y = k * 5
	Max = y - 1
	a = min(Max, n)
	b = min(Max, m)
	point = y - a
	res += max(0, b - point + 1)
print(res)


(n, m) = list(map(int, input().split()))
n1 = [n // 5, n // 5, n // 5, n // 5, n // 5]
k = n % 5
for i in range(k):
	n1[i] += 1
m1 = [m // 5, m // 5, m // 5, m // 5, m // 5]
k = m % 5
s = 0
for i in range(k):
	m1[i] += 1
for i in range(5):
	s += n1[i] * m1[3 - i]
print(s)


import sys
LI = lambda : list(map(int, sys.stdin.readline().split()))
MI = lambda : map(int, sys.stdin.readline().split())
SI = lambda : sys.stdin.readline().strip('\n')
II = lambda : int(sys.stdin.readline())
(n, m) = MI()
nn = {i: 0 for i in range(5)}
mm = {i: 0 for i in range(5)}
for i in range(1, n + 1):
	nn[i % 5] += 1
for i in range(1, m + 1):
	mm[i % 5] += 1
ans = nn[0] * mm[0] + nn[1] * mm[4] + nn[2] * mm[3] + nn[3] * mm[2] + nn[4] * mm[1]
print(ans)


(x, y) = input().split()
x = int(x)
y = int(y)
a = min(x, y)
y = max(x, y)
x = a
ans = 0
for i in range(1, x + 1):
	f = i // 5
	s = (i + y) // 5
	ans += s - f
print(ans)


(a, b) = map(int, input().split(' '))
m = min(a, b)
n = max(a, b)
c = 0
for i in range(1, m + 1):
	num = i % 5
	if num == 0:
		num = 5
	init = abs(5 - num)
	ans = abs(n - init) // 5
	if num != 5 and num + n >= 5:
		ans += 1
	c += ans
print(c)


k = list(map(int, input().split()))
n = k[0]
m = k[1]
ListN = [n // 5, n // 5, n // 5, n // 5, n // 5]
ListM = [m // 5, m // 5, m // 5, m // 5, m // 5]
Rn = n % 5
Rm = m % 5
for i in range(0, Rn):
	ListN[i] += 1
for i in range(0, Rm):
	ListM[i] += 1
ans = ListN[0] * ListM[3] + ListN[1] * ListM[2] + ListN[2] * ListM[1] + ListN[3] * ListM[0] + ListN[4] * ListM[4]
print(ans)


import sys
from bisect import bisect_left, bisect_right
from collections import deque, Counter
from math import gcd, sqrt, factorial, ceil
from itertools import permutations
inf = float('inf')
mod = 1000000007
mini = 1000000007

def fact(n):
	if n == 0:
		return 1
	p = 1
	d = 10 ** 9 + 7
	for i in range(1, n + 1):
		p = p * i
		p = p % d
	return p

def ncr(n, r):
	d = 10 ** 9 + 7
	num = fact(n)
	den = fact(r) * fact(n - r) % d
	den = pow(den, d - 2, d)
	return num * den % d

def sieve(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p]:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p = p + 1
	return prime

def binary(number):
	result = 0
	while number:
		result = result + 1
		number = number & number - 1
	return result

def calculate_factors(n):
	hh = [1] * (n + 1)
	p = 2
	while p * p < n:
		if hh[p] == 1:
			for i in range(p * 2, n, p):
				hh[i] = 0
		p += 1
	total = 1
	for p in range(2, n + 1):
		if hh[p] == 1:
			count = 0
			if n % p == 0:
				while n % p == 0:
					n = int(n / p)
					count += 1
				total *= count + 1
	return total

def get_array():
	return list(map(int, sys.stdin.readline().strip().split()))

def get_ints():
	return map(int, sys.stdin.readline().strip().split())

def input():
	return sys.stdin.readline().strip()
(n, m) = get_ints()
rem_n = [0] * 5
rem_m = [0] * 5
if n < 5:
	for i in range(1, n + 1):
		rem_n[i] = 1
else:
	store = n // 5
	for i in range(5):
		rem_n[i] = store
	store = n - n // 5 * 5
	for i in range(1, store + 1):
		rem_n[i] = rem_n[i] + 1
if m < 5:
	for i in range(1, m + 1):
		rem_m[i] = 1
else:
	store = m // 5
	for i in range(5):
		rem_m[i] = store
	store = m - m // 5 * 5
	for i in range(1, store + 1):
		rem_m[i] = rem_m[i] + 1
i = 1
j = 4
total = rem_n[0] * rem_m[0]
while i <= 4 and j > -1:
	total = total + rem_n[i] * rem_m[j]
	i = i + 1
	j = j - 1
print(total)


(n, m) = map(int, input().split())
answer = n // 5 * (m // 5)
for i in range(1, 5):
	x = n // 5
	y = m // 5
	if n % 5 >= i:
		x += 1
	if m % 5 >= 5 - i:
		y += 1
	answer = answer + x * y
print(answer)


(a, b) = map(int, input().split())
sum = 0
sum += a * int(b / 5)
sum += int(a / 5) * (b % 5)
if a % 5 + b % 5 >= 5:
	sum += (a % 5 + b % 5) % 5 + 1
print(sum)


(n, m) = tuple(map(int, input().split()))
ans = 0
for i in range(0, 5):
	a = n // 5
	b = m // 5
	if i == 0:
		a -= 1
	if n % 5 >= i:
		a += 1
	if m % 5 >= 5 - i:
		b += 1
	ans += a * b
print(ans)


(a, b) = list(map(int, input().split()))
temp = a
a_dict = {'0': temp // 5, '1': temp // 5, '2': temp // 5, '3': temp // 5, '4': temp // 5}
temp = temp % 5
while temp:
	a_dict[str(temp)] = a_dict[str(temp)] + 1
	temp -= 1
temp = b
b_dict = {'0': temp // 5, '1': temp // 5, '2': temp // 5, '3': temp // 5, '4': temp // 5}
temp = temp % 5
while temp:
	b_dict[str(temp)] = b_dict[str(temp)] + 1
	temp -= 1
count = a_dict['0'] * b_dict['0']
for i in range(1, 5):
	count += a_dict[str(i)] * b_dict[str(5 - i)]
print(count)


import sys
import collections
from collections import Counter
import itertools
import math
import timeit
input = sys.stdin.readline

def sieve(n):
	if n < 2:
		return list()
	prime = [True for _ in range(n + 1)]
	p = 3
	while p * p <= n:
		if prime[p]:
			for i in range(p * 2, n + 1, p):
				prime[i] = False
		p += 2
	r = [2]
	for p in range(3, n + 1, 2):
		if prime[p]:
			r.append(p)
	return r

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

def divn(n, primes):
	divs_number = 1
	for i in primes:
		if n == 1:
			return divs_number
		t = 1
		while n % i == 0:
			t += 1
			n //= i
		divs_number *= t

def flin(d, x, default=-1):
	left = right = -1
	for i in range(len(d)):
		if d[i] == x:
			if left == -1:
				left = i
			right = i
	if left == -1:
		return (default, default)
	else:
		return (left, right)

def ceil(n, k):
	return n // k + (n % k != 0)

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

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

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

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

def prr(a, sep=' '):
	print(sep.join(map(str, a)))

def dd():
	return collections.defaultdict(int)

def ddl():
	return collections.defaultdict(list)
(a, b) = mi()
da = [a // 5] * 5
db = [b // 5] * 5
res = 0
for i in range(1, a % 5 + 1):
	da[i] += 1
for i in range(1, b % 5 + 1):
	db[i] += 1
for i in range(1, 5):
	res += da[i] * db[-i]
print(res + da[0] * db[0])


(n, m) = map(int, input().split())
ans = 5 * (n // 5) * (m // 5)
p = n % 5
q = m % 5
tmp = 0
for i in range(1, p + 1):
	for j in range(1, q + 1):
		if (i + j) % 5 == 0:
			tmp += 1
(res1, res2) = (0, 0)
for i in range(1, p + 1):
	for j in range(1, 6):
		if (i + j) % 5 == 0:
			res1 += 1
for i in range(1, q + 1):
	for j in range(1, 6):
		if (i + j) % 5 == 0:
			res2 += 1
ans = ans + res1 * (m // 5) + res2 * (n // 5) + tmp
print(ans)


(n, m) = [int(i) for i in input().split()]
p = min(n, m)
q = max(n, m)
x = q // 5
y = p // 5
z = p - p // 5 * 5
c = 0
if q % 5 != 0:
	for i in range(x * 5 + 1, q + 1):
		if p >= 5 - i % 5:
			c += 1
	if c != 0:
		if y == 0:
			print(x * p + y * c + c)
		else:
			print(x * p + y * c + max(0, z - 4 + c))
	else:
		print(x * p + y * c)
else:
	print(x * p)


(n, m) = [int(s) for s in input().split()]
remainder_freq = [0] * 5
for k in range(1, m + 1):
	remainder_freq[k % 5] += 1
ans = 0
for x in range(1, n + 1):
	ans += remainder_freq[(5 - x % 5) % 5]
print(ans)


import math
(n, m) = map(int, input().split(' '))
count = 0
ans = set()
for x in range(1, min(n, m) + 1):
	if x % 5 == 0:
		count = count + (max(n, m) + x % 5) // 5
	else:
		count = count + (max(n, m) + x % 5) // 5
print(count)


(t, y) = input().split()
m = int(t)
n = int(y)
c = 0
for i in range(1, n + 1):
	c += (i + m) // 5 - i // 5
print(c)


inp = input().split()
n = int(inp[0])
m = int(inp[1])
a = max(n, m)
b = min(n, m)
x = a // 5 * b
m = 5 - a % 5
n = b % 5
x += b // 5 * (a % 5)
for i in range(b - b % 5 + 1, b + 1):
	n = i % 5
	if n >= m:
		x += 1
print(x)


import sys, math, string, bisect
input = sys.stdin.readline
from collections import deque
L = lambda : list(map(int, input().split()))
Ls = lambda : list(input().split())
M = lambda : map(int, input().split())
I = lambda : int(input())
(a, b) = M()
l = [a // 5] * 5
m = [b // 5] * 5
if a % 5:
	for i in range(1, a % 5 + 1):
		l[i] += 1
if b % 5:
	for i in range(1, b % 5 + 1):
		m[i] += 1
c = 0
for i in range(1, 5):
	c += l[i] * m[5 - i]
c += l[0] * m[0]
print(c)


from __future__ import division, print_function
import os
import sys
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip
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 math import sqrt, floor, factorial, gcd, log
from collections import deque, Counter, defaultdict
input = lambda : sys.stdin.readline().rstrip('\r\n')
read = lambda : list(map(int, input().strip().split(' ')))

def min_div(n):
	for i in range(2, 32):
		if n % i == 0:
			return i

def solve():
	(a, b) = read()
	a_dic = {i: a // 5 for i in range(5)}
	b_dic = {i: b // 5 for i in range(5)}
	for i in range(1, a % 5 + 1):
		a_dic[i] += 1
	for i in range(1, b % 5 + 1):
		b_dic[i] += 1
	ans = 0
	for i in range(5):
		ans += a_dic[i] * b_dic[(5 - i) % 5]
	print(ans)
solve()


(n, m) = map(int, input().split())
nc = n // 5
mc = m // 5
ans = mc * nc * 5
for i in range(1, n - 5 * nc + 1):
	ans += mc
	if m >= mc * 5 + (5 - i):
		ans += 1
for i in range(1, m - 5 * mc + 1):
	ans += nc
print(ans)


(n, m) = map(int, input().split())
if n < m:
	x = n
	y = m
else:
	x = m
	y = n
c = 0
for i in range(1, x + 1):
	t = y + i
	c += t // 5 - i // 5
print(c)


(n, m) = sorted([int(x) for x in input().split()])
r = 0
for i in range(1, n + 1):
	r += m // 5 + int(m % 5 >= 5 - i % 5)
print(r)


(n, m) = list(map(int, input().split()))
(l1, l2) = ([], [])
for i in range(1, n + 1):
	l1.append(i % 5)
for i in range(1, m + 1):
	l2.append(i % 5)
l1.sort()
l2.sort()
total = 0
total += l1.count(0) * l2.count(0)
total += l1.count(1) * l2.count(4)
total += l1.count(2) * l2.count(3)
total += l1.count(3) * l2.count(2)
total += l1.count(4) * l2.count(1)
print(total)


s = input().split()
n = int(s[0])
m = int(s[1])
ans = 0
if m < n:
	t = m
	m = n
	n = t
for i in range(1, n + 1):
	x = 5 - i % 5
	if m >= x:
		ans += (m - x) // 5 + 1
print(ans)


(a, b) = [int(i) for i in input().split()]
a0 = 0
a1 = 0
a2 = 0
a3 = 0
a4 = 0
b0 = 0
b1 = 0
b2 = 0
b3 = 0
b4 = 0
for i in range(1, a + 1):
	if i % 5 == 0:
		a0 = a0 + 1
	elif i % 5 == 1:
		a1 += 1
	elif i % 5 == 2:
		a2 += 1
	elif i % 5 == 3:
		a3 += 1
	else:
		a4 += 1
for i in range(1, b + 1):
	if i % 5 == 0:
		b0 = b0 + 1
	elif i % 5 == 1:
		b1 += 1
	elif i % 5 == 2:
		b2 += 1
	elif i % 5 == 3:
		b3 += 1
	else:
		b4 += 1
print(a0 * b0 + a1 * b4 + a2 * b3 + a3 * b2 + a4 * b1)


from __future__ import division, print_function
from fractions import Fraction
import sys
import os
from io import BytesIO, IOBase
from heapq import *
from math import gcd, factorial, floor, ceil
from copy import deepcopy
from collections import deque
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 = 10 ** 9 + 7

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 pp in range(t):
		solve(pp)

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

def google(p):
	print('Case #' + str(p) + ': ', end='')

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

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

def ncr(n, r):
	return factorial(n) // (factorial(r) * factorial(max(n - r, 1)))

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True

def solve(case):
	(n, m) = sep()
	cnt1 = [0] * 5
	cnt2 = [0] * 5
	for i in range(1, m + 1):
		cnt1[i % 5] += 1
	for i in range(1, n + 1):
		cnt2[i % 5] += 1
	ans = 0
	ans += cnt1[0] * cnt2[0]
	ans += cnt1[1] * cnt2[4]
	ans += cnt1[2] * cnt2[3]
	ans += cnt1[3] * cnt2[2]
	ans += cnt1[4] * cnt2[1]
	print(ans)
testcase(1)


i = input()
i = i.split()
n = int(i[0])
m = int(i[1])
a = min(n, m)
b = max(n, m)
i = 5
ans = 0
while i < n + m + 1:
	if i <= a:
		ans += i - 1
	elif i > a and i <= b:
		ans += a
	else:
		ans += a - i + b + 1
	i += 5
print(ans)


(n, m) = map(int, input().split())
full_n = n // 5
full_m = m // 5
print(full_n * full_m * 5 + full_n * (m % 5) + full_m * (n % 5) + sum((1 for x in range(0, n % 5 + 1) for y in range(0, m % 5 + 1) if (x + y) % 5 == 0)) - 1)


[n, m] = list(map(int, input().split(' ')))
r = n // 5 * (m // 5)
for i in range(1, 5):
	r += (n // 5 + (n % 5 >= i)) * (m // 5 + (m % 5 >= 5 - i))
print(r)


(n, m) = map(int, input().split())
a1 = n // 5
r1 = [a1, a1, a1, a1, a1]
a2 = n % 5
for i in range(1, a2 + 1):
	r1[i] += 1
b1 = m // 5
r2 = [b1, b1, b1, b1, b1]
b2 = m % 5
for i in range(1, b2 + 1):
	r2[i] += 1
s = r1[0] * r2[0] + r1[1] * r2[4] + r1[2] * r2[3] + r1[3] * r2[2] + r1[4] * r2[1]
print(s)


(a, b) = map(int, input().split())
s = 0
for i in range(1, a + 1):
	t = 5 - i % 5
	s += (b - t) // 5 + 1
print(s)


(n, m) = map(int, input().split())
d1 = [0] * 5
d2 = [0] * 5
for i in range(5):
	d1[i] += n // 5
	d2[i] += m // 5
nn = n % 5
mm = m % 5
for i in range(1, nn + 1):
	d1[i] += 1
for i in range(1, mm + 1):
	d2[i] += 1
num = 0
for i in range(5):
	for j in range(5):
		if (i + j) % 5 == 0:
			num += d1[i] * d2[j]
print(num)


def main():
	(X, Y) = map(int, input().split())
	ans = 0
	for x in range(1, min(X, Y) + 1):
		ans += (x + max(X, Y)) // 5 - x // 5
	print(ans)
main()


(n, m) = map(int, input().split())
val = [0] * 5
for i in range(5):
	val[i] = m // 5 + (1 if m % 5 >= 4 - i and i != 4 else 0)
print(sum(val) * (n // 5) + sum(val[:n % 5]))


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

def fill_arr(n):
	return [0 for x in range(n)]
(x, y) = inp()
(a, b) = (fill_arr(5), fill_arr(5))
for i in range(1, x + 1):
	a[i % 5] += 1
for i in range(1, y + 1):
	b[i % 5] += 1
sum = a[0] * b[0]
for i in range(1, 5):
	sum += a[i] * b[5 - i]
print(sum)


import sys

def main():
	x = sys.stdin.readline().split()
	(n, m) = (int(x[0]), int(x[1]))
	k = int(n / 5)
	rest = n - k * 5
	a = [k] * 5
	for i in range(rest):
		a[i + 1] += 1
	k = int(m / 5)
	rest = m - k * 5
	b = [k] * 5
	for i in range(rest):
		b[i + 1] += 1
	r = a[0] * b[0] + a[1] * b[4] + a[2] * b[3] + a[3] * b[2] + a[4] * b[1]
	print(r)
main()


(m, n) = map(int, input().split())
a = min(m, n)
n = max(m, n)
m = a
mim = 0
for i in range(1, m + 1):
	f = i // 5
	s = (i + n) // 5
	mim += s - f
print(mim)


import time

def func(x):
	ax = [x // 5 for i in range(5)]
	for i in range(1, x % 5 + 1):
		ax[i] += 1
	return ax
(n, m) = (int(i) for i in input().split())
start = time.time()
an = func(n)
am = func(m)
ans = an[0] * am[0]
for i in range(1, 5):
	ans = ans + an[i] * am[5 - i]
print(ans)
finish = time.time()


(a, b) = list((int(x) for x in input().split()))
p = a % 5
q = b % 5
t = 0
for i in range(1, p + 1):
	for j in range(1, q + 1):
		if (i + j) % 5 == 0:
			t += 1
print(a // 5 * (b // 5) * 5 + a % 5 * (b // 5) + b % 5 * (a // 5) + t)


(n, m) = map(int, input().split())
r = 0
e = n % 5
N = [n // 5 for _ in range(5)]
for i in range(1, e + 1):
	N[i] += 1
e = m % 5
M = [m // 5 for _ in range(5)]
for i in range(1, e + 1):
	M[i] += 1
for i in range(1, 5):
	r += N[i] * M[5 - i]
print(r + N[0] * M[0])


(a, b) = map(int, input().split())
pairs = 0
for x in range(1, a + 1):
	c = 5 - x % 5
	if b >= c:
		pairs += 1 + (b - c) // 5
print(pairs)


def main():
	(n, m) = map(int, input().split())
	y = {}
	for i in range(1, 6):
		y[i] = max((m - i) // 5 + 1, 0)
	count = sum(y.values()) * (n // 5)
	rem = n % 5
	for i in range(1, rem + 1):
		count += y[5 - i]
	print(count)
main()


(n, m) = [int(x) for x in input().split()]
freq1 = [0 for x in range(5)]
freq2 = [0 for x in range(5)]
for i in range(1, n + 1):
	freq1[i % 5] += 1
for i in range(1, m + 1):
	freq2[i % 5] += 1
c = 0
for i in range(5):
	c += freq1[i % 5] * freq2[abs(5 - i) % 5]
print(c)


import math
(n, m) = map(int, input().split())
c = [0 for i in range(5)]
for i in range(5):
	a = math.ceil((m - i) / 5)
	b = 5 - (m - i) % 5
	c[b - 1] = a
d = sum(c) * (n // 5)
e = n % 5
d += sum(c[:e])
print(d)


from math import *

def main():
	(n, m) = map(int, input().split())
	ans = 0
	for i in range(1, n + 1):
		y = 5 - i % 5
		ans += int(ceil((m + 1 - y) / 5))
	print(ans)
main()


a = 0
t = 0
(c, x) = map(int, input().split())
a = x // 5
if x % 5 == 0:
	print(a * c)
else:
	lst = list(range(a * 5 + 1, x + 1))
	for z in lst:
		e = 5 - z % 5
		while e <= c:
			t += 1
			e += 5
	print(a * c + t)


(n, m) = map(int, input().split())
res = 0
a = [None] * 5
for i in range(5):
	a[i] = 0
for i in range(1, m + 1):
	a[i % 5] += 1
for i in range(1, n + 1):
	res += a[(5 - i % 5) % 5]
print(res)


(var1, var2) = input().split()
p = int(var1)
q = int(var2)
a = p // 5
b = p % 5
c = q // 5
d = q % 5
sum = 0
sum = p * c + a * d
for i in range(b):
	for j in range(d):
		if (i + j + 2) % 5 == 0:
			sum += 1
print(sum)


[b, k] = list(map(int, input().split()))
bq = b // 5
kq = k // 5
br = b % 5
kr = k % 5
s = bq * kq
for i in range(1, 5):
	if br >= i:
		bm = bq + 1
	else:
		bm = bq
	if kr >= 5 - i:
		km = kq + 1
	else:
		km = kq
	s += bm * km
print(s)


(n, m) = map(int, input().split())
min_nm = min(n, m)
max_nm = max(n, m)
count = 0
for i in range(1, min_nm + 1):
	count += (i + max_nm) // 5 - (i + 1) // 5
	if (i + 1) % 5 == 0:
		count += 1
print(count)


def main():
	l = input().split()
	n = int(min(int(l[0]), int(l[1])))
	m = int(max(int(l[0]), int(l[1])))
	nbr = 0
	for i in range(1, n + 1):
		nbr += (i % 5 + m) // 5
	print(nbr)
main()


(n, m) = sorted(list(map(int, input().split())))
a = n // 5
x = {1: a, 2: a, 3: a, 4: a, 0: a}
for i in range(1, n % 5 + 1):
	x[i] = a + 1
b = m // 5
y = {4: b, 3: b, 2: b, 1: b, 0: b}
for j in range(m % 5):
	y[4 - j] = b + 1
ans = 0
for i in range(5):
	ans += x[i] * y[i]
print(ans)


import sys
(n, m) = map(int, input().split())
cnt = 0
for i in range(1, n + 1):
	y = 5 - i % 5
	if y <= m:
		diff = int((m - y) / 5)
		cnt += diff + 1
print(cnt)


buff = input().split(' ')
n = int(buff[0])
m = int(buff[1])
ns = [n // 5, n // 5, n // 5, n // 5, n // 5]
for i in range(1, n % 5 + 1):
	ns[i] += 1
ms = [m // 5, m // 5, m // 5, m // 5, m // 5]
for i in range(1, m % 5 + 1):
	ms[i] += 1
res = ns[0] * ms[0]
for i in range(1, 5):
	res += ns[i] * ms[5 - i]
print(res)


from math import ceil, floor
(n, m) = map(int, input().split())
res = 0
for i in range(1, n + 1):
	req = 5 - i % 5
	res += (m - req) // 5 + 1
print(res)


(n, m) = list(map(int, input().split()))
cnt = 0
for x in range(1, n + 1):
	cnt += (x % 5 + m) // 5
print(cnt)


(n, m) = list(map(int, input().split()))
left_first = [n // 5] * 5
left_second = [m // 5] * 5
for i in range(n % 5):
	left_first[i] += 1
for j in range(m % 5):
	left_second[j] += 1
ans = left_first[-1] * left_second[-1]
for i in range(4):
	ans += left_first[i] * left_second[3 - i]
print(ans)


(a, b) = map(int, input().split())
f = 0
j = 0
for i in range(1, 1 + 5):
	f = (b + i % 5) // 5
	h = (a + (5 - i)) // 5
	j += f * h
print(j)


a = input().split(' ')
(temp, ans, count, i, n, m) = (1, 0, 0, 5, int(a[0]), int(a[1]))
if n > m:
	(n, m) = (m, n)
while temp > 0:
	if n >= i:
		temp = i - 1
	elif m >= i:
		temp = n
	elif i > m:
		temp = n - (i - m) + 1
	if temp > 0:
		ans += temp
	i += 5
print(ans)


(x, y) = map(int, input().split())
ans = 0
for i in range(5):
	j = (5 - i) % 5
	cti = x // 5
	if i and x % 5 >= i:
		cti += 1
	ctj = y // 5
	if j and y % 5 >= j:
		ctj += 1
	ans += cti * ctj
print(ans)


(n, m) = list(map(int, input().split()))
(count1, count2, count3, count4, count12, count32, count42, count22) = (0, 0, 0, 0, 0, 0, 0, 0)
count0 = 0
count02 = 0
for i in range(1, n % 10 + 1):
	if i % 5 == 1:
		count1 += 1
	if i % 5 == 2:
		count2 += 1
	if i % 5 == 3:
		count3 += 1
	if i % 5 == 4:
		count4 += 1
	if i % 5 == 0:
		count0 += 1
for i in range(1, m % 10 + 1):
	if i % 5 == 1:
		count12 += 1
	if i % 5 == 2:
		count22 += 1
	if i % 5 == 3:
		count32 += 1
	if i % 5 == 4:
		count42 += 1
	if i % 5 == 0:
		count02 += 1
to1inn = 2 * (n // 10) + count1
to2inn = 2 * (n // 10) + count2
to3inn = 2 * (n // 10) + count3
to4inn = 2 * (n // 10) + count4
to1inm = 2 * (m // 10) + count12
to2inm = 2 * (m // 10) + count22
to3inm = 2 * (m // 10) + count32
to4inm = 2 * (m // 10) + count42
to0inn = 2 * (n // 10) + count0
to0inm = 2 * (m // 10) + count02
print(to1inn * to4inm + to2inn * to3inm + to3inn * to2inm + to4inn * to1inm + to0inm * to0inn)


(a, b) = map(int, input().split())
c = max(a, b)
(d, r, s) = (c // 5, c % 5, 0)
for x in range(1, min(a, b) + 1):
	if (r + x % 5) // 5 == 1:
		s += d + 1
	else:
		s += d
print(s)


import math
(n, m) = map(int, input().split())
if n > m:
	temp = n
	n = m
	m = temp
result = 0
for i in range(1, n + 1):
	result += int((m + i % 5) / 5)
print(result)


import re
import sys
from bisect import bisect, bisect_left, insort, insort_left
from collections import Counter, defaultdict, deque
from copy import deepcopy
from decimal import Decimal
from fractions import gcd
from itertools import accumulate, combinations, combinations_with_replacement, groupby, permutations, product
from math import acos, asin, atan, ceil, cos, degrees, factorial, hypot, log2, pi, radians, sin, sqrt, tan
from operator import itemgetter, mul
from string import ascii_lowercase, ascii_uppercase, digits

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

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

def instr():
	s = input()
	return list(s[:len(s)])

def invr():
	return map(int, input().split())
(n, m) = invr()
res = 0
for i in range(1, n + 1):
	p = (m + i) // 5
	q = i // 5
	original = p - q
	res += original
print(res)


(n, m) = input().split()
(n, m) = (int(n), int(m))
start = 0
count = 0
add = [m // 5, m // 5, m // 5, m // 5, m // 5]
if m % 5 == 1:
	add[0] += 1
elif m % 5 == 2:
	add[0] += 1
	add[1] += 1
elif m % 5 == 3:
	add[0] += 1
	add[1] += 1
	add[2] += 1
elif m % 5 == 4:
	add[0] += 1
	add[1] += 1
	add[2] += 1
	add[3] += 1
for i in range(1, n + 1):
	if i % 5 == 1:
		count += add[3]
	elif i % 5 == 2:
		count += add[2]
	elif i % 5 == 3:
		count += add[1]
	elif i % 5 == 4:
		count += add[0]
	else:
		count += add[4]
print(int(count))


from sys import stdin as Si, maxsize as m
from math import floor as F
from collections import defaultdict as dt, Counter as Co
from operator import itemgetter as ig
from math import pi
from itertools import product as P
(n, m) = map(int, Si.readline().split())
(cn, cm) = (n // 5, m // 5)
(en, em) = (n % 5, m % 5)
total = cn * cm * 5 + cn * em + en * cm
for i in range(1, en + 1):
	for j in range(1, em + 1):
		if (i + j) % 5 == 0:
			total += 1
print(total)


def f(x, y):
	return y // 5 - (x - 1) // 5
(n, m) = map(int, input().split())
s = 0
for i in range(1, n + 1):
	s += f(1 + i, m + i)
print(s)


(n, m) = list(map(int, input().split()))
k = 1
t = 0
while True:
	if k * 5 - n > m:
		break
	xin = 1 if k * 5 - 1 <= m else k * 5 - m
	xen = k * 5 - 1 if k * 5 <= n else n
	tm = xen - xin + 1
	t += tm
	k += 1
print(t)


import sys
import os
from io import BytesIO, IOBase
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')
mod = 10 ** 9 + 7

def lcm(x, y):
	return x * y / gcd(x, y)

def fact(x, mod=mod):
	ans = 1
	for i in range(1, x + 1):
		ans = ans * i % mod
	return ans

def arr2D(n, m, default=0):
	lst = []
	for i in range(n):
		temp = [default] * m
		lst.append(temp)
	return lst

def sortDictV(x):
	return {k: v for (k, v) in sorted(x.items(), key=lambda item: item[1])}

def solve(n, m):
	count = {}
	for i in range(1, m + 1):
		s = str(i)[-1]
		if count.get(s) == None:
			count[s] = 1
		else:
			count[s] += 1
	cnt = 0
	(five, ten) = (0, 0)
	for i in range(1, n + 1):
		s = str(i)[-1]
		if int(s) == 0:
			ten = 0
		else:
			ten = 10 - int(s)
		if int(s) > 5:
			five = 15 - int(s)
		else:
			five = 5 - int(s)
		if count.get(str(five)):
			cnt += count[str(five)]
		if count.get(str(ten)):
			cnt += count[str(ten)]
	return cnt
(n, m) = list(map(int, input().split()))
print(solve(n, m))


(n, m) = map(int, input().split())
r = 0
for i in range(1, n + 1):
	c = i % 5
	r += m // 5
	if m % 5 + c >= 5:
		r += 1
print(r)


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():
	(n, m) = LI()
	a = []
	b = []
	for i in range(5):
		a.append((n + 4 - i) // 5)
		b.append((m + 4 - i) // 5)
	r = a[-1] * b[-1]
	for i in range(4):
		r += a[i] * b[-2 - i]
	return r
print(main())


l = list(map(int, input().strip().split()))
(n, m) = (l[0], l[1])
res = 0
for i in range(1, n + 1):
	res += int((m + int(i % 5)) / 5)
print(res)


import math
(n, m) = map(int, input().split())
a = max(n, m)
b = min(n, m)
a = [i for i in range(1, a + 1)]
num = b // 5
d = {1: num, 2: num, 3: num, 4: num, 5: num}
extra = b % 5
for key in d:
	if key <= extra:
		d[key] += 1
ans = 0
ans += d[1] * math.ceil(len(a[3:]) / 5)
ans += d[2] * math.ceil(len(a[2:]) / 5)
ans += d[3] * math.ceil(len(a[1:]) / 5)
ans += d[4] * math.ceil(len(a) / 5)
ans += d[5] * (len(a) // 5)
print(ans)


(n, m) = map(int, input().split())
a = [int(n / 5) for i in range(5)]
if n % 5 == 4:
	a[0] += 1
	a[1] += 1
	a[2] += 1
	a[3] += 1
elif n % 5 == 3:
	a[1] += 1
	a[2] += 1
	a[3] += 1
elif n % 5 == 2:
	a[2] += 1
	a[3] += 1
elif n % 5 == 1:
	a[3] += 1
final = sum(a) * int(m / 5)
temp = m % 5
for i in range(temp):
	final += a[i]
print(final)


from math import *
from copy import *
from string import *
from random import *
from sys import stdin
from sys import maxsize
from operator import *
from itertools import *
from collections import Counter
import math

def bin1(l, r, k, t, b, val, ans):
	if l > r:
		return ans
	else:
		mid = (l + r) // 2
		v = k ** mid
		if v == val:
			return v
		elif v > val:
			ans = mid
			return bin1(mid + 1, r, k, t, b, val, ans)
		else:
			return bin1(l, mid - 1, k, t, b, val, ans)

def bin2(l, r, k, t, b, val, ans):
	if l > r:
		return ans
	else:
		mid = (l + r) // 2
		v = t * k ** mid + b * mid
		if v == val:
			return v
		elif v > val:
			ans = mid
			return bin2(l, mid - 1, k, t, b, val, ans)
		else:
			return bin2(mid + 1, r, k, t, b, val, ans)

def SieveOfEratosthenes(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	l = []
	for i in range(2, n + 1):
		if prime[i]:
			l.append(i)
	return l

def bin(l, r, ll, val):
	if l > r:
		return -1
	else:
		mid = (l + r) // 2
		if val >= ll[mid][0] and val <= ll[mid][1]:
			return mid
		elif val < ll[mid][0]:
			return bin(l, mid - 1, ll, val)
		else:
			return bin(mid + 1, r, ll, val)

def deci(n):
	s = ''
	while n != 0:
		if n % 2 == 0:
			n = n // 2
			s = '0' + s
		else:
			n = n // 2
			s = '1' + s
	return s

def diff(s1, s2):
	if len(s1) < len(s2):
		v = len(s1)
		while v != len(s2):
			s1 = '0' + s1
			v = v + 1
	else:
		v = len(s2)
		while v != len(s1):
			s2 = '0' + s2
			v = v + 1
	c = 0
	for i in range(len(s1)):
		if s1[i:i + 1] != s2[i:i + 1]:
			c = c + 1
	return c
from sys import stdin, stdout

def fac(a, b):
	v = a
	while a != b:
		v *= a - 1
		a = a - 1
	return v

def bino(l, r, n):
	if l > r:
		return -1
	else:
		mid = (l + r) // 2
		val1 = math.log(n / mid + 1, 2)
		val2 = int(val1)
		if val1 == val2:
			return val1
		elif val1 < 1.0:
			return bino(l, mid - 1, n)
		else:
			return bino(mid + 1, r, n)

def binary(l, r, ll, val, ans):
	if l > r:
		return ans
	else:
		mid = (l + r) // 2
		if val % ll[mid] == 0:
			ans = ll[mid]
			return binary(l, mid - 1, ll, val, ans)
		else:
			return binary(l, mid - 1, ll, val, ans)

def odd(n, ans, s):
	if n % 2 != 0 or n in s:
		return ans
	else:
		s.add(n)
		return odd(n // 2, ans + 1, s)
(n, m) = map(int, input().split(' '))
count = 0
for i in range(1, n + 1):
	val = i % 5
	count += (m + val) // 5
print(count)


import math
(n, m) = [int(x) for x in input().split(' ')]
pairs = 0
for x in range(1, n + 1):
	pairs += math.floor((x % 5 + m) / 5)
print(pairs)


(n, m) = map(int, input().split())
cnt = n // 5 * (m // 5)
for k in range(1, 5):
	if k > n:
		continue
	if 5 - k > m:
		continue
	k1 = max(0, (n - k) // 5)
	k2 = max(0, (m - (5 - k)) // 5)
	cnt += (k1 + 1) * (k2 + 1)
print(cnt)


(n, m) = map(int, input().split())
total = 0
d = {}
for i in range(1, n + 1):
	val = i % 5
	if val in d:
		d[val] += 1
	else:
		d[val] = 1
for i in range(1, m + 1):
	val = i % 5
	if val == 0 and val in d:
		total += d[val]
	else:
		val = 5 - val
		if val in d:
			total += d[val]
print(total)


(n, m) = map(int, input().split())
A = [n // 5 for i in range(5)]
B = [m // 5 for i in range(5)]
for i in range(5):
	if n % 5 > i:
		A[i] += 1
for i in range(5):
	if m % 5 > i:
		B[i] += 1
print(A[0] * B[3] + A[1] * B[2] + A[2] * B[1] + A[3] * B[0] + A[4] * B[4])


(a, b) = map(int, input().split())
c = 0
for i in range(5):
	c += (a + i) // 5 * ((b + (5 - i) % 5) // 5)
print(c)


(m, n) = map(int, input().split())
print((m + 4) // 5 * ((n + 1) // 5) + (m + 1) // 5 * ((n + 4) // 5) + (m + 3) // 5 * ((n + 2) // 5) + (m + 2) // 5 * ((n + 3) // 5) + n // 5 * (m // 5))


def main():
	from sys import stdin, stdout
	(a, b) = map(int, stdin.readline().split())
	counter = 0
	modcounter = [0, 0, 0, 0, 0]
	for i in range(1, max(a + 1, b + 1)):
		modcounter[i % 5 - 1] += 1
	for i in range(1, min(a + 1, b + 1)):
		counter += modcounter[4 - i % 5]
	stdout.write(str(counter))
main()


(n, m) = map(int, input().split(' '))
a = n // 5
b = m // 5
c = n % 5
d = m % 5
if c == 3:
	if d == 2:
		x = 1
	if d == 3:
		x = 2
	if d == 4:
		x = 3
x = max(c + d - 4, 0)
print(a * b * 5 + c * b + d * a + x)


(n, m) = map(int, input().split())
a = dict()
b = dict()
for i in range(0, 5):
	a[i] = (n - i) // 5 + 1
	b[i] = (m - i) // 5 + 1
total = 0
a[0] -= 1
b[0] -= 1
for i in range(0, 5):
	total += a[i] * b[(5 - i) % 5]
print(total)


(n, m) = list(map(int, input().split()))
k = 5
if n < m:
	(n, m) = (m, n)
modk = [0] * k
for i in range(1, m + 1):
	modk[i % k] += 1
ans = 0
for i in range(1, n + 1):
	ans += modk[(k - i % k) % k]
print(ans)


(n, m) = map(int, input().split())
ans = 0
for i in range(n):
	d = 5 - (i + 1) % 5
	ans += int(m / 5)
	if m % 5 >= d:
		ans += 1
print(ans)


(n, m) = map(int, input().split())
s = 0
for i in range(n):
	ost = 5 - (i + 1) % 5
	if ost <= m:
		s = s + (m - ost) // 5 + 1
print(s)


(a, b) = map(int, input().split())
tot = 0
for i in range(1, a + 1):
	tot += (b + i % 5) // 5
print(tot)


str = input().split()
n = int(str[0])
m = int(str[1])
frq = [0] * 5
ans = 0
for i in range(1, n + 1):
	p = i % 5
	frq[p] += 1
for i in range(1, m + 1):
	k = i % 5
	if k != 0:
		k = 5 - k
	ans += frq[k]
print(ans)


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

def array2d(d1, d2, init=None):
	return [[init for _ in range(d1)] for _ in range(d2)]
(n, m) = list(map(int, input().split(' ')))
s = 0
for i in range(5):
	t1 = n // 5
	t2 = m // 5
	if i != 0:
		t1 += 1 if n % 5 >= i else 0
		t2 += 1 if m % 5 >= 5 - i else 0
	s += t1 * t2
print(s)


(n, m) = map(int, input().split())
x = min(n, m)
y = max(n, m)
count = 0
for i in range(1, x + 1):
	j = 5 - i % 5
	count += (y - j) // 5
	count += 1
print(count)


(x, y) = map(int, input().split())
A = [x // 5 for i in range(5)]
B = [y // 5 for i in range(5)]
amariA = x % 5
amariB = y % 5
for i in range(1, amariA + 1):
	A[i] += 1
for i in range(1, amariB + 1):
	B[i] += 1
ttl = A[0] * B[0]
for i in range(1, 5):
	ttl += A[i] * B[5 - i]
print(ttl)


(n, m) = [int(x) for x in input().split()]
count = 0
for i in range(1, 6):
	count += (n + (5 - i) % 5) // 5 * ((m + i % 5) // 5)
print(count)


params = list(map(int, input().split()))
(n, m) = (params[0], params[1])
count = 0
parciais = [0] * 5
for r in range(1, m + 1):
	parciais[r % 5] += 1
for r in range(1, n + 1):
	count += parciais[(5 - r % 5) % 5]
print(count)


(a, b) = map(int, input().split())
count = 0
for i in range(1, a + 1):
	x = 5 - i % 5
	if b - x >= 0:
		count = count + int((b - x) / 5) + 1
print(count)


(n, m) = map(int, input().split())
l1 = [0] * 5
l2 = [0] * 5
for i in range(1, n + 1):
	l1[i % 5] += 1
for j in range(1, m + 1):
	l2[j % 5] += 1
ans = l1[0] * l2[0]
for i in range(1, 5):
	ans += l1[i] * l2[5 - i]
print(ans)


(n, m) = list(map(int, input().split()))
a = [n // 5] * 5
b = [m // 5] * 5
for i in range(n % 5):
	a[i] += 1
for i in range(m % 5):
	b[i] += 1
ans = a[4] * b[4]
for i in range(4):
	ans += a[i] * b[3 - i]
print(ans)


import sys
import math
import itertools
import collections

def sieve(n):
	if n < 2:
		return list()
	prime = [True for _ in range(n + 1)]
	p = 3
	while p * p <= n:
		if prime[p]:
			for i in range(p * 2, n + 1, p):
				prime[i] = False
		p += 2
	r = [2]
	for p in range(3, n + 1, 2):
		if prime[p]:
			r.append(p)
	return r

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

def prime(n):
	if n == 2:
		return True
	if n % 2 == 0 or n <= 1:
		return False
	sqr = int(math.sqrt(n)) + 1
	for d in range(3, sqr, 2):
		if n % d == 0:
			return False
	return True

def convn(number, base):
	newnumber = 0
	while number > 0:
		newnumber += number % base
		number //= base
	return newnumber

def cdiv(n, k):
	return n // k + (n % k != 0)

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

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

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

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

def wr(arr):
	return ' '.join(map(str, arr))

def revn(n):
	return str(n)[::-1]

def dd():
	return collections.defaultdict(int)

def ddl():
	return collections.defaultdict(list)
(n, m) = mi()
print(n // 5 * (m // 5) * 5 + m // 5 * (n % 5) + n // 5 * (m % 5) + max(0, n % 5 + m % 5 - 4))


(f, s) = [int(x) for x in input().split()]
a = [0] * 5
b = [0] * 5
for i in range(f):
	index = (i + 1) % 5
	a[index] += 1
for j in range(s):
	index = (j + 1) % 5
	b[index] += 1
total = a[0] * b[0] + a[1] * b[4] + a[2] * b[3] + a[3] * b[2] + a[4] * b[1]
print(total)


(n, m) = map(int, input().split())
ans = 0
cnt_n = [0] * 5
cnt_m = [0] * 5
for i in range(1, n + 1):
	cnt_n[i % 5] += 1
for i in range(1, m + 1):
	cnt_m[i % 5] += 1
ans += cnt_n[0] * cnt_m[0]
for i in range(1, 5):
	ans += cnt_n[i] * cnt_m[4 - i + 1]
print(ans)


xx = list(map(int, input().split()))
a = xx[0]
b = xx[1]
i = (a + b) // 5 * 5
ans = 0
r = 0
while 2 == 2:
	r = i
	if a < i - 1 and b < i - 1:
		ans += i - 1 - (i - 1 - a + (i - 1 - b))
		r = i
	elif a < i - 1:
		ans += a
		r = i
	elif b < i - 1:
		ans += b
		r = i
	else:
		break
	i -= 5
complete = sum(list(range(5, r + 5, 5))) - len(list(range(5, r + 5, 5)))
print(ans + complete)


(x, y) = map(int, input().split())
count_x = [0] * 5
count_x[0] = x // 5
for i in range(1, 5):
	if x >= i:
		count_x[i] = (x - i) // 5 + 1
count_y = [0] * 5
count_y[0] = y // 5
for i in range(1, 5):
	if y >= i:
		count_y[i] = (y - i) // 5 + 1
ans = 0
for i in range(5):
	ans += count_x[i] * count_y[(5 - i) % 5]
print(ans)


(n, m) = map(int, input().split())
if n > m:
	(n, m) = (m, n)
c = 0
for i in range(1, n + 1):
	if i % 5 == 1:
		c += (m + 1) // 5
	elif i % 5 == 2:
		c += (m + 2) // 5
	elif i % 5 == 3:
		c += (m + 3) // 5
	elif i % 5 == 4:
		c += (m + 4) // 5
	elif i % 5 == 0:
		c += m // 5
print(c)


(n, m) = map(int, input().split())
cnt = [0 for _ in range(0, 5)]
for i in range(1, m + 1):
	cnt[i % 5] += 1
ans = 0
for i in range(1, n + 1):
	if i % 5 == 0:
		ans += cnt[0]
	else:
		ans += cnt[5 - i % 5]
print(ans)


(n, m) = sorted([int(j) for j in input().split()])
count = 0
import math
for j in range(1, n + 1):
	f = int(j / 5) + 1
	an = m
	d = 5 * f
	a = d - j
	N = math.floor((an - a) / 5) + 1
	count += N
print(count)


(n, m) = list(map(int, input().split()))
cm = {}
cn = {}
x = n // 5
y = m // 5
for i in range(5):
	cm[i] = y
	cn[i] = x
x = n % 5
y = m % 5
for i in range(1, x + 1):
	cn[i] += 1
for i in range(1, y + 1):
	cm[i] += 1
res = cm[0] * cn[0]
for i in range(1, 5):
	res += cm[i] * cn[5 - i]
print(res)


(n, m) = map(int, input().split())
num1 = [0] * 5
num2 = [0] * 5
for i in range(5):
	num1[i] = n // 5
	if n % 5 >= i:
		num1[i] += 1
	num2[i] = m // 5
	if m % 5 >= i:
		num2[i] += 1
num1[0] -= 1
num2[0] -= 1
ans = num1[0] * num2[0] + num1[1] * num2[4] + num1[2] * num2[3] + num1[3] * num2[2] + num1[4] * num2[1]
print(ans)


from sys import stdin, stdout
from math import gcd, ceil, sqrt
ii1 = lambda : int(stdin.readline().strip())
is1 = lambda : stdin.readline().strip()
iia = lambda : list(map(int, stdin.readline().strip().split()))
isa = lambda : stdin.readline().strip().split()
mod = 1000000007
(n, m) = iia()
d = {}
for i in range(1, n + 1):
	d.setdefault(i % 5, [0])[0] += 1
res = 0
for i in range(1, m + 1):
	cur = 5 - i % 5 if i % 5 != 0 else 0
	res += d.get(cur, [0])[0]
print(res)


(n, m) = map(int, input().split())
narr = [n // 5, n // 5 + min(1, n % 5), n // 5 + min(2, n % 5) // 2, n // 5 + min(3, n % 5) // 3, n // 5 + min(4, n % 5) // 4]
marr = [m // 5, m // 5 + min(1, m % 5), m // 5 + min(2, m % 5) // 2, m // 5 + min(3, m % 5) // 3, m // 5 + min(4, m % 5) // 4]
count = 0
for i in range(5):
	count += narr[i] * marr[-i]
print(count)


(m, n) = input().split()
m = int(m)
n = int(n)
M = m // 10
MM = m % 10
a = [M] * 10
for i in range(MM):
	a[i + 1] += 1
N = n // 10
NN = n % 10
b = [N] * 10
for i in range(NN):
	b[i + 1] += 1
ans = (a[0] + a[5]) * (b[5] + b[0]) + (a[1] + a[6]) * (b[4] + b[9]) + (a[2] + a[7]) * (b[3] + b[8]) + (a[3] + a[8]) * (b[2] + b[7]) + (a[4] + a[9]) * (b[1] + b[6])
print(ans)


(n, m) = map(int, input().split())
n += 1
m += 1
cntn = [n // 5, n // 5, n // 5, n // 5, n // 5]
cntm = [m // 5, m // 5, m // 5, m // 5, m // 5]
n %= 5
m %= 5
for i in range(0, n):
	cntn[i] += 1
for i in range(0, m):
	cntm[i] += 1
cntn[0] -= 1
cntm[0] -= 1
ans = 0
for i in range(0, 5):
	ans += cntn[i] * cntm[(5 - i) % 5]
print(ans)


(n, m) = list(map(int, input().split()))
nt = n // 5
mt = m // 5
nf = [nt] * 5
mf = [mt] * 5
for x in range(n % 5 + 1):
	nf[x] += 1
for x in range(m % 5 + 1):
	mf[x] += 1
nf[0] -= 1
mf[0] -= 1
ans = 0
for x in range(5):
	y = (5 - x) % 5
	ans += nf[x] * mf[y]
print(ans)


(n, m) = map(int, input().split())
cap = m // 5
others = m % 5
result = n * cap
cap2 = n // 5
result += cap2 * others
for i in range(cap2 * 5 + 1, cap2 * 5 + n % 5 + 1):
	for j in range(cap * 5 + 1, cap * 5 + others + 1):
		if (i + j) % 5 == 0:
			result += 1
print(result)


(n, m) = list(map(int, input().split()))
n_rem = [n // 5 for _ in range(5)]
for i in range(1, n % 5 + 1):
	n_rem[i] += 1
m_rem = [m // 5 for _ in range(5)]
for i in range(1, m % 5 + 1):
	m_rem[i] += 1
print(sum([n_rem[i] * m_rem[(5 - i) % 5] for i in range(5)]))


s = input()
l = s.split()
n = int(l[0])
m = int(l[1])
rep = (n + m) // 5
mini = min(n, m)
sum = 0
for i in range(1, rep + 1):
	multiple = i * 5
	if multiple - 1 <= n and multiple - 1 <= m:
		sum += multiple - 1
	elif n == m or (multiple > n and multiple > m):
		sum += n - (multiple - m) + 1
	else:
		sum += mini
print(sum)


from math import ceil
(n, m) = map(int, input().split())
if n > m:
	(n, m) = (m, n)
total = 0
maior = m
for i in range(1, n + 1):
	total += (i + maior) // 5 - ceil((i + 1) / 5) + 1
print(total)


(n, m) = map(int, input().split())
m1 = 0
m2 = 0
m3 = 0
m4 = 0
n1 = 0
n2 = 0
n3 = 0
n4 = 0
m0 = 0
n0 = 0
for i in range(1, n + 1):
	if i % 5 == 1:
		n1 += 1
	elif i % 5 == 2:
		n2 += 1
	elif i % 5 == 3:
		n3 += 1
	elif i % 5 == 4:
		n4 += 1
	else:
		n0 += 1
for i in range(1, m + 1):
	if i % 5 == 1:
		m1 += 1
	elif i % 5 == 2:
		m2 += 1
	elif i % 5 == 3:
		m3 += 1
	elif i % 5 == 4:
		m4 += 1
	else:
		m0 += 1
print(n4 * m1 + n3 * m2 + n2 * m3 + n1 * m4 + n0 * m0)


import sys
input = sys.stdin.readline
(x, y) = map(int, input().split())
a = max(x, y)
ans = 0
for i in range(1, min(x, y) + 1):
	ans += (a + i) // 5
	ans -= i // 5
print(ans)


from math import floor
(n, m) = map(int, input().split())
counter = 0
for number in range(1, n + 1):
	counter += floor((m - (5 - number % 5)) / 5) + 1
print(counter)


(n, m) = map(int, input().split())
dn = [n // 10] * 10
dm = [m // 10] * 10
for i in range(1, 11):
	if i <= n % 10:
		dn[i - 1] += 1
for i in range(1, 11):
	if i <= m % 10:
		dm[i - 1] += 1
l = [(4, 9), (3, 8), (2, 7), (1, 6), (10, 5), (4, 9), (3, 8), (2, 7), (1, 6), (10, 5)]
ans = 0
for i in range(len(l)):
	for j in l[i]:
		ans += dn[i] * dm[j - 1]
print(ans)


(n, m) = list(map(int, input().split()))
n5 = [0] * 5
for i in range(1, n + 1):
	n5[i % 5] += 1
m5 = [0] * 5
for i in range(1, m + 1):
	m5[i % 5] += 1
print(n5[0] * m5[0] + n5[1] * m5[4] + n5[2] * m5[3] + n5[3] * m5[2] + n5[4] * m5[1])


(n, m) = map(int, input().split(' '))
res = 0
for i in range(1, 6):
	if n % 5 >= i:
		res += (i % 5 + m) // 5 * (n // 5 + 1)
	else:
		res += (i % 5 + m) // 5 * (n // 5)
print(res)


(x, y) = map(int, input().split())
d = {}
ans = 0
for i in range(0, 5):
	d[i] = 0
for i in range(1, x + 1):
	d[i % 5] = d[i % 5] + 1
for j in range(1, y + 1):
	ans = ans + d[(5 - j % 5) % 5]
print(ans)


def g_m(v):
	l_r = [0] * 5
	l_r[0] = v // 5
	for i in range(1, 5):
		l_r[i] = l_r[0] + (1 if v % 5 >= i else 0)
	return l_r
(x, y) = map(int, input().split())
l_mx = g_m(x)
l_my = g_m(y)
t = 0
for i in range(5):
	t += l_mx[i] * l_my[(5 - i) % 5]
print(t)


(n, m) = map(int, input().split())
ans = 0
for i in range(5):
	ni = len(list(range(i + 1, n + 1, 5)))
	if 5 - i - 1 != 0:
		mi = len(list(range(5 - i - 1, m + 1, 5)))
	else:
		mi = len(list(range(5, m + 1, 5)))
	ans += ni * mi
print(ans)


(n, m) = map(int, input().split())
nr = [0] * 5
mr = [0] * 5
for i in range(1, n + 1):
	nr[i % 5] += 1
for i in range(1, m + 1):
	mr[i % 5] += 1
ans = 0
for i in range(5):
	ans += nr[i] * mr[(5 - i) % 5]
print(ans)


def ceil(a, b):
	return -(-a // b)

def answer(n, m):
	num_of_ns_like_1 = max((n - 1) // 5 + 1, 0)
	num_of_ns_like_2 = max((n - 2) // 5 + 1, 0)
	num_of_ns_like_3 = max((n - 3) // 5 + 1, 0)
	num_of_ns_like_4 = max((n - 4) // 5 + 1, 0)
	num_of_ns_like_5 = max((n - 5) // 5 + 1, 0)
	ans = (m + 1) // 5 * num_of_ns_like_1
	ans += (m + 2) // 5 * num_of_ns_like_2
	ans += (m + 3) // 5 * num_of_ns_like_3
	ans += (m + 4) // 5 * num_of_ns_like_4
	ans += m // 5 * num_of_ns_like_5
	return ans

def main():
	(n, m) = [int(i) for i in input().split()]
	print(answer(n, m))
	return
main()


(n, m) = map(int, input().split())
n1 = [n // 5, (n - 1) // 5 + 1, (n - 2) // 5 + 1, (n - 3) // 5 + 1, (n - 4) // 5 + 1]
m1 = [m // 5, (m - 1) // 5 + 1, (m - 2) // 5 + 1, (m - 3) // 5 + 1, (m - 4) // 5 + 1]
print(n1[0] * m1[0] + n1[1] * m1[4] + n1[2] * m1[3] + n1[3] * m1[2] + n1[4] * m1[1])


(n, m) = [int(i) for i in input().split()]
a = {0: 0, 1: 0, 2: 0, 3: 0, 4: 0}
b = {0: 0, 1: 0, 2: 0, 3: 0, 4: 0}
keys = [0, 1, 2, 3, 4]
for i in keys:
	a[i] = n // 5
	b[i] = m // 5
n %= 5
m %= 5
for i in range(1, n + 1):
	a[i] += 1
for i in range(1, m + 1):
	b[i] += 1
ret = 0
for i in keys:
	j = (5 - i) % 5
	ret += a[i] * b[j]
print(ret)


(n, m) = list(map(int, input().split()))
nMod = [n // 5] * 5
mMod = [m // 5] * 5
for loop in range(1, n % 5 + 1):
	nMod[loop] += 1
for loop in range(1, m % 5 + 1):
	mMod[loop] += 1
print(nMod[0] * mMod[0] + nMod[1] * mMod[4] + nMod[4] * mMod[1] + nMod[2] * mMod[3] + nMod[3] * mMod[2])


import sys
from itertools import product
from random import randint

def readlines(type=int):
	return list(map(type, sys.stdin.readline().split()))

def read(type=int):
	return type(sys.stdin.readline().strip())
joint = lambda it, sep=' ': sep.join([str(i) if type(i) != list else sep.join(map(str, i)) for i in it])

def solve_naive(n, m):
	total = 0
	for (x, y) in product(range(1, n + 1), range(1, m + 1)):
		if (x + y) % 5 == 0:
			total += 1
	return total

def solve(n, m):
	total = 0
	(l, u) = sorted([n, m])
	sum = n + m
	max_multiple = sum // 5
	multiples = [i * 5 for i in range(1, max_multiple + 1)]
	for multiple in multiples:
		can = min(l, multiple - 1) - (multiple - min(u, multiple - 1)) + 1
		total += can
	return total

def main():
	(n, m) = readlines()
	print(solve(n, m))

def test():
	count = 0
	while True:
		count += 1
		n = randint(1, 1000000)
		m = randint(1, 1000000)
		assert solve(n, m) == solve_naive(n, m)
		print(count)
main()


from sys import stdin, stdout, exit
import math
from fractions import gcd

def sin():
	return stdin.readline().rstrip()

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

def printBS(li):
	if not li:
		return
	for i in range(len(li) - 1):
		stdout.write('%d ' % li[i])
	stdout.write('%d\n' % li[-1])
(n, m) = listInput()
ans = 0
for i in range(1, n + 1):
	a = -i % 5
	if a == 0:
		a = 5
	if a > m:
		continue
	ans += (m - a + 5) // 5
print(ans)


import math
precalc = [0, 0, 0, 0, 0]
(n, m) = map(int, input().split())
for i in range(1, m + 1):
	precalc[i % 5] += 1
cnt = 0
for i in range(1, n + 1):
	cnt += precalc[(5 - i % 5) % 5]
print(cnt)


def read(type=int):
	return type(input())

def read_arr(type=int):
	return [type(token) for token in input().split()]

def solution(a, b, c, A, B):
	A.sort()
	B.sort()
	aa = min(a, len(A))
	bb = min(b, len(B))
	s = 0
	for i in range(aa):
		s += A[i]
	for i in range(bb):
		s += B[i]

def run():
	(n, m) = read_arr()
	A = [0] * 5
	B = [0] * 5
	for i in range(1, n + 1):
		A[i % 5] += 1
	for i in range(1, m + 1):
		B[i % 5] += 1
	s = 0
	s += A[0] * B[0]
	s += A[1] * B[4]
	s += A[2] * B[3]
	s += A[3] * B[2]
	s += A[4] * B[1]
	print(s)
run()


(x, y) = map(int, input().split())
cnt = [0] * 6
ans = [0] * 6
for i in range(1, y + 1):
	ans[5 - i % 5] += 1
	cnt[5 - i % 5] += 1
xx = x // 5
x %= 5
for i in range(1, 6):
	ans[i] *= xx
for i in range(1, x + 1):
	ans[i] += cnt[i]
print(sum(ans))


(m, n) = [int(i) for i in input().split()]
freqM = [0] * 5
freqN = [0] * 5
for i in range(1, m + 1):
	freqM[i % 5] += 1
for i in range(1, n + 1):
	freqN[i % 5] += 1
ans = freqM[0] * freqN[0] + freqM[1] * freqN[4] + freqM[2] * freqN[3] + freqM[3] * freqN[2] + freqM[4] * freqN[1]
print(ans)


def compute():
	(n, m) = map(int, input().split())
	ans = 0
	for it in range(1, n + 1):
		ans += (m + it % 5) // 5
	return ans
print(compute())


(m, n) = map(int, input().split())
a = [0] * 5
b = [0] * 5
p = m % 5
q = n % 5
for i in range(1, 5):
	if i <= p:
		a[i] = int(m / 5) + 1
	else:
		a[i] = int(m / 5)
a[0] = int(m / 5)
for i in range(1, 5):
	if i <= q:
		b[i] = int(n / 5) + 1
	else:
		b[i] = int(n / 5)
b[0] = int(n / 5)
print(a[0] * b[0] + a[1] * b[4] + a[2] * b[3] + a[3] * b[2] + a[4] * b[1])


from math import floor
(n, m) = map(int, input().split())
total = 0
for x in range(1, n + 1):
	total += floor((m + x % 5) / 5)
print(total)


(n, m) = map(int, input().split())
zer1 = n // 5
zer2 = m // 5
one1 = (n - 1) // 5 + 1
one2 = (m - 1) // 5 + 1
two1 = (n - 2) // 5 + 1
two2 = (m - 2) // 5 + 1
three1 = (n - 3) // 5 + 1
three2 = (m - 3) // 5 + 1
four1 = (n - 4) // 5 + 1
four2 = (m - 4) // 5 + 1
print(zer1 * zer2 + one1 * four2 + two1 * three2 + three1 * two2 + four1 * one2)


(n, m) = map(int, input().split())
first = m // 10 * 2 * n
second = m % 10 * 2 * (n // 10)
n = n % 10
m = m % 10
third = 0
for i in range(1, n + 1):
	if 5 - i >= 1 and 5 - i <= m:
		third += 1
	if 10 - i >= 1 and 10 - i <= m:
		third += 1
	if 15 - i >= 1 and 15 - i <= m:
		third += 1
print(first + second + third)


import math
(col, fil) = input().split()
col = int(col)
fil = int(fil)
arr1 = [0, 0, 0, 0, 0]
arr2 = [0, 0, 0, 0, 0]
definido1 = int((col - col % 5) / 5)
definido2 = int((fil - fil % 5) / 5)
modu1 = col % 5
modu2 = fil % 5
for x in range(5):
	arr1[x] = definido1
	arr2[x] = definido2
for x in range(1, 5):
	if modu1 > 0:
		arr1[x] = arr1[x] + 1
		modu1 = modu1 - 1
	if modu2 > 0:
		arr2[x] = arr2[x] + 1
		modu2 = modu2 - 1
res = arr1[0] * arr2[0]
for x in range(1, 5):
	res = res + arr1[x] * arr2[5 - x]
print(res)


(n, m) = map(int, input().split())
countn = {}
for x in range(1, n + 1):
	countn[x % 5] = countn.get(x % 5, 0) + 1
res = 0
for x in range(1, m + 1):
	n = x % 5
	if n == 0:
		n = 5
	res += countn.get(5 - n, 0)
print(res)


import sys
import math
import bisect

def solve(n, m):
	A = [0] * 5
	B = [0] * 5
	for i in range(1, n + 1):
		A[i % 5] += 1
	for i in range(1, m + 1):
		B[i % 5] += 1
	ans = 0
	for i in range(5):
		for j in range(5):
			if (i + j) % 5 == 0:
				ans += A[i] * B[j]
	return ans

def main():
	(n, m) = map(int, input().split())
	ans = solve(n, m)
	print(ans)
main()


(n, k) = map(int, input().split())
counter = 0
if n > k:
	h1 = k
	h2 = n
else:
	h1 = n
	h2 = k
d = h2 // 5
mod = h2 % 5
r = h1 // 5
mod2 = h1 % 5
counter = d * r * 5 + mod * r + mod2 * d
for i in range(mod):
	for j in range(mod2):
		if (i + 1 + (j + 1)) % 5 == 0:
			counter += 1
print(int(counter))


from sys import stdin

def parse():
	line = stdin.readline().split()
	(M, N) = map(int, line)
	if M > N:
		temp = M
		M = N
		N = temp
	res = []
	mor5 = min(M, 5)
	for i in range(1, mor5 + 1):
		max_x = int((N + i) / 5) * 5 - i
		cnt = 0 if max_x < 0 else int(max_x / 5) if max_x % 5 == 0 else int(max_x / 5) + 1
		res.append(cnt)
	s = 0
	i = 0
	(quo, rem) = (int(M / 5), M % 5)
	s += sum(res) * quo
	s += sum(res[:rem])
	print(s)
parse()


(n, m) = (int(i) for i in input().split())
l1 = [0] * 5
l2 = [0] * 5
for i in range(1, n + 1):
	l1[i % 5] += 1
for i in range(1, m + 1):
	l2[i % 5] += 1
s = l1[0] * l2[0] + l1[1] * l2[4] + l1[2] * l2[3] + l1[3] * l2[2] + l1[4] * l2[1]
print(s)


import math
y = [int(i) for i in input().split()]
n = y[0]
m = y[1]
s = n // 5 * (m // 5) * 5
for i in range(1, n + 1):
	for j in range(m // 5 * 5 + 1, m + 1):
		if i > n // 5 * 5:
			continue
		if (j + i) % 5 == 0:
			s += 1
for j in range(1, m + 1):
	for i in range(n // 5 * 5 + 1, n + 1):
		if (j + i) % 5 == 0:
			s += 1
print(s)


__author__ = 'aste'

def main():
	(n, m) = [int(x) for x in input().split()]
	res = 0
	for i in range(0, 5):
		cnt_n = (n - i) // 5
		cnt_m = (m - (5 - i) % 5) // 5
		if cnt_n < 0 or cnt_m < 0:
			continue
		if i > 0:
			cnt_n += 1
			cnt_m += 1
		res += cnt_n * cnt_m
	print(res)
main()


(n, m) = list(map(int, input().split()))
(mod1, mod2, mod3, mod4, mod5) = (n // 5, n // 5, n // 5, n // 5, n // 5)
if n % 5 >= 1:
	mod1 += 1
if n % 5 >= 2:
	mod2 += 1
if n % 5 >= 3:
	mod3 += 1
if n % 5 == 4:
	mod4 += 1
(m1, m2, m3, m4, m5) = (m // 5, m // 5, m // 5, m // 5, m // 5)
if m % 5 >= 1:
	m1 += 1
if m % 5 >= 2:
	m2 += 1
if m % 5 >= 3:
	m3 += 1
if m % 5 == 4:
	m4 += 1
print(mod1 * m4 + mod2 * m3 + mod3 * m2 + mod4 * m1 + mod5 * m5)


def div(f, m, n):
	k = min(m, n, f)
	if k == f:
		return f - 1
	mini = min(m, n)
	(mi, mx) = (mini, m + n - mini)
	if mx >= f:
		return mi
	return mi - (f - mx) + 1
(m, n) = (int(i) for i in input().split(' '))
i = 1
ans = 0
while i * 5 <= m + n:
	ans += div(i * 5, m, n)
	i += 1
print(ans)


def solve():
	(n, m) = map(int, input().split())
	(nn, mm) = ([0] * 5, [0] * 5)
	for i in range(1, n + 1):
		nn[i % 5] += 1
	for i in range(1, m + 1):
		mm[i % 5] += 1
	print(nn[0] * mm[0] + nn[1] * mm[4] + nn[2] * mm[3] + nn[3] * mm[2] + nn[4] * mm[1])
solve()


(n, m) = map(int, input().split())
cnt = 0
c = 0
for i in range(0, n):
	if (i + 1) % 5 == 0:
		c += 1
	temp = i + m + 1
	cnt += temp // 5 - c
print(cnt)


import math

def fact(n):
	ans = 1
	for i in range(2, n + 1):
		ans *= i
	return ans

def comb(n, c):
	return fact(n) // (fact(n - c) * c)
(n, m) = map(int, input().split())
(n, m) = (min(n, m), max(n, m))
d = {i: 0 for i in range(5)}
for i in range(1, n + 1):
	d[i % 5] += 1
ans = 0
for i in range(1, m + 1):
	ans += d[(5 - i % 5) % 5]
print(ans)


(n, m) = map(int, input().split())
(n, m) = (max(n, m), min(n, m))
delta = 0
if n - m < m:
	delta = m - (n - m)
res = 0
mul = 5
while mul <= n + m:
	if mul <= n and mul <= m:
		res += mul - 1
	elif mul < n:
		res += m
	else:
		if n != mul:
			res += 1
		res += m - (mul - n)
	mul += 5
print(res)


def f(l):
	(n, m) = l
	c1 = [(n + 5 - i) // 5 for i in range(5)]
	c2 = [(m + 5 - i) // 5 for i in range(5)]
	return (c1[0] - 1) * (c2[0] - 1) + sum([c1[i] * c2[5 - i] for i in range(1, 5)])
l = list(map(int, input().split()))
print(f(l))


import sys
inp = input().split()
m = int(inp[0])
n = int(inp[1])
m_5 = m % 5
n_5 = n % 5
k_m = m // 5
k_n = n // 5
res = 5 * k_n * k_m + m_5 * k_n + n_5 * k_m
for i in range(1, m_5 + 1):
	for j in range(1, n_5 + 1):
		if i + j % 5 == 5:
			res += 1
print(res)


(n, m) = map(int, input().split())
x = n // 5
y = m // 5
a = [x for i in range(5)]
b = [y for i in range(5)]
x = n % 5
y = m % 5
for i in range(x):
	a[i] += 1
for i in range(y):
	b[i] += 1
s = 0
for i in range(5):
	if i == 4:
		s += a[i] * b[i]
	else:
		s += a[i] * b[3 - i]
print(s)


(n, m) = list(map(int, input().split()))
(mat, sat) = ([n // 5] * 5, [m // 5] * 5)
for i in range(n % 5):
	mat[i] += 1
for j in range(m % 5):
	sat[j] += 1
print(sum([mat[i] * sat[5 - i - 2] for i in range(5)]))


from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
from __future__ import absolute_import
import math
import string
import itertools
import fractions
import heapq
import collections
import re
import array
import bisect

def array2d(d1, d2, init=None):
	return [[init for _ in range(d1)] for _ in range(d2)]
(n, m) = map(int, input().split(' '))
s = 0
for i in range(5):
	t1 = n // 5
	t2 = m // 5
	if i != 0:
		t1 += 1 if n % 5 >= i else 0
		t2 += 1 if m % 5 >= 5 - i else 0
	s += t1 * t2
print(s)


a = input().split()
a1 = int(a[0])
a2 = int(a[1])
ost1 = [0, 0, 0, 0, 0]
ost2 = [0, 0, 0, 0, 0]
for i in range(1, a1 % 5 + 1):
	ost1[i] += 1
for i in range(1, a2 % 5 + 1):
	ost2[i] += 1
a1 = a1 // 5
a2 = a2 // 5
c = a1 * a2
for i in range(1, 5):
	c = c + (a1 + ost1[i]) * (a2 + ost2[5 - i])
print(c)


(a, b) = map(int, input().split())
x = min(a, b)
y = max(a, b)
ans = 0
for i in range(1, x + 1):
	k = i + 1
	while k % 5 != 0:
		k += 1
	temp = (y - (k - i)) // 5
	if temp >= 0:
		ans += temp + 1
print(ans)


(a, b) = map(int, input().split())
d = {}
d[0] = 0
d[1] = 0
d[2] = 0
d[3] = 0
d[4] = 0
for i in range(1, a + 1):
	d[i % 5] += 1
t = {}
t[0] = 0
t[1] = 0
t[2] = 0
t[3] = 0
t[4] = 0
for i in range(1, b + 1):
	t[i % 5] += 1
print(d[0] * t[0] + d[1] * t[4] + d[2] * t[3] + d[3] * t[2] + d[4] * t[1])


d = {0: 0, 1: 0, 3: 0, 4: 0, 2: 0}
(n, m) = map(int, input().split())
s = 0
for i in range(1, n + 1):
	d[i % 5] += 1
for i in range(1, m + 1):
	if i % 5 == 0:
		s += d[0]
	else:
		s += d[5 - i % 5]
print(s)


(n, m) = list(map(int, input().split()))
f1 = [0] * 5
f2 = [0] * 5
for i in range(1, n + 1):
	f1[i % 5] += 1
for i in range(1, m + 1):
	f2[i % 5] += 1
print(f1[0] * f2[0] + f1[1] * f2[4] + f2[1] * f1[4] + f1[2] * f2[3] + f2[2] * f1[3])


(n, m) = map(int, input().split())
l = [0] * 5
d = [0] * 5
for i in range(1, n + 1):
	x = i % 5
	l[x] += 1
for j in range(1, m + 1):
	x = j % 5
	d[x] += 1
s = l[0] * d[0]
for i in range(1, 5):
	s = s + l[i] * d[5 - i]
print(s)


(n, m) = list(map(int, input().split()))
l1 = [0, 0, 0, 0, 0]
l2 = [0, 0, 0, 0, 0]
for i in range(1, n + 1):
	l1[i % 5] += 1
for i in range(1, m + 1):
	l2[i % 5] += 1
ans = l1[0] * l2[0]
ans += l1[1] * l2[4]
ans += l1[2] * l2[3]
ans += l2[2] * l1[3]
ans += l2[1] * l1[4]
print(ans)


(n, m) = list(map(int, input().split()))
count = 0
first_five = [-1] * 5
for i in range(1, 5):
	first_five[i - 1] = (m - (5 - i)) // 5 + 1
first_five[4] = m // 5
total_five = sum(first_five)
print(total_five * (n // 5) + sum(first_five[:n % 5]))


(n, m) = tuple([int(x) for x in input().split()])
a = [0 for x in range(5)]
b = [0 for x in range(5)]
count = 0
for i in range(1, n + 1):
	a[i % 5] += 1
for i in range(1, m + 1):
	b[i % 5] += 1
count = a[0] * b[0]
for i in range(1, 5):
	count += a[i] * b[5 - i]
print(count)


(n, m) = map(int, input().split())
(ar1, ar2) = ([0] * 5, [0] * 5)
for i in range(1, n + 1):
	ar1[i % 5] += 1
for i in range(1, m + 1):
	ar2[i % 5] += 1
print(ar1[0] * ar2[0] + ar1[1] * ar2[4] + ar1[2] * ar2[3] + ar1[3] * ar2[2] + ar1[4] * ar2[1])


from sys import stdin as fin
(n, m) = map(int, fin.readline().split())
result = 0
for i in range(1, n + 1):
	result += (m - (5 - i % 5)) // 5 + 1
print(result)


import math
(n, m) = list(map(int, input().split()))
ans = 0
for i in range(1, n + 1):
	ans += math.ceil(((i + m) // 5 * 5 - i) / 5)
print(ans)


from collections import Counter
(n, m) = map(int, input().strip().split())
a = [i % 5 for i in range(1, n + 1)]
b = [i % 5 for i in range(1, m + 1)]
countsA = Counter(a)
countsB = Counter(b)
ans = 0
for i in countsA:
	if i == 0:
		ans += countsA[i] * countsB[i]
	else:
		ans += countsA[i] * countsB[5 - i]
print(ans)


[m, n] = map(int, input().split())
a1 = [i % 5 for i in range(1, m + 1, 1)]
b1 = [a1.count(j) for j in range(5)]
a2 = [i % 5 for i in range(1, n + 1, 1)]
b2 = [a2.count(j) for j in range(5)]
print(b1[0] * b2[0] + b1[1] * b2[4] + b1[2] * b2[3] + b1[3] * b2[2] + b1[4] * b2[1])


import sys
I = sys.stdin.readline
(n, m) = map(int, I().split())
cnt = 0
for i in range(1, n + 1):
	cnt += (m + i) // 5 - i // 5
print(cnt)


(n, m) = [int(y) for y in input().split()]
if n > m:
	(n, m) = (m, n)
res = 0
for i in range(1, n + 1):
	res += (m + i) // 5 - i // 5
print(res)


(n, m) = map(int, input().split())
maxi = max(n, m)
mini = min(n, m)
mycnt = mini // 5 * 5 * (maxi // 5)
mycnt += mini % 5 * (maxi // 5)
mycnt += maxi % 5 * (mini // 5)
for i in range(1, maxi % 5 + 1):
	for j in range(i, mini % 5 + 1):
		if (i + j) % 5 == 0:
			mycnt += 1
for i in range(1, mini % 5 + 1):
	for j in range(i, maxi % 5 + 1):
		if (i + j) % 5 == 0:
			mycnt += 1
print(mycnt)


(n, m) = map(int, input().split())
ans = 0
i = 1
while i <= n:
	ans += (m + i % 5) // 5
	i += 1
print(ans)


inp = input().split()
(n, m) = (int(inp[0]), int(inp[1]))
ans = 0
for i in range(n):
	ans += (m + i + 1) // 5 - (i + 1) // 5
print(ans)


import math
(n, m) = map(int, input().split())
(m1, m2) = (min(n, m), max(n, m))
count = 0
for i in range(1, m1 + 1):
	count += (m2 - i // 5 * 5 + i) // 5
print(count)


(n, m) = map(int, input().split())
(a, b) = (n // 5, m // 5)
(x1, x2) = ([a, a + int(n % 5 >= 1), a + int(n % 5 >= 2), a + int(n % 5 >= 3), a + int(n % 5 >= 4)], [b, b + int(m % 5 >= 1), b + int(m % 5 >= 2), b + int(m % 5 >= 3), b + int(m % 5 >= 4)])
print(x1[0] * x2[0] + x1[1] * x2[4] + x1[2] * x2[3] + x1[3] * x2[2] + x1[4] * x2[1])


(n, m) = [int(i) for i in input().split()]
freq_n = {i: 0 for i in range(5)}
freq_m = {i: 0 for i in range(5)}
for i in range(5):
	freq_n[i] = n // 5
	freq_m[i] = m // 5
for i in range(1, n % 5 + 1):
	freq_n[i] += 1
for i in range(1, m % 5 + 1):
	freq_m[i] += 1
res = 0
res += freq_n[0] * freq_m[0]
res += freq_n[1] * freq_m[4]
res += freq_n[2] * freq_m[3]
res += freq_n[3] * freq_m[2]
res += freq_n[4] * freq_m[1]
print(res)


(n, m) = (int(x) for x in input().split())
narray = [n // 5 for i in range(5)]
marray = [m // 5 for i in range(5)]
for extran in range(0, n % 5):
	narray[extran] += 1
for extram in range(0, m % 5):
	marray[extram] += 1
answer = 0
answer += narray[0] * marray[3]
answer += narray[1] * marray[2]
answer += narray[2] * marray[1]
answer += narray[3] * marray[0]
answer += narray[4] * marray[4]
print(answer)


(x, y) = input().split(' ')
x = int(x)
y = int(y)
if x > y:
	(x, y) = (y, x)
i = 1
j = 4
count = 0
while j <= y:
	j = j + 5
	count += 1
j = j - 5
first = 4
last = j
increaser = count
for i in range(2, x + 1):
	first -= 1
	if first < 1:
		first = 5
		increaser -= 1
	last = last - 1
	if last + 5 <= y:
		last = last + 5
		increaser = increaser + 1
	count = count + increaser
print(count)


(n, m) = list(map(int, input().split()))
c = n // 5 * (m // 5)
if n > m:
	(n, m) = (m, n)
for i in range(1, m + 1):
	if i % 5 == 0:
		continue
	x = 5 - i % 5
	c += (n - x) // 5 + 1
print(str(c))


from sys import stdin
(n, m) = [int(x) for x in stdin.readline().rstrip().split()]
countRemFirst = [0, 0, 0, 0, 0]
countRemSecond = [0, 0, 0, 0, 0]
for i in range(1, n + 1):
	countRemFirst[i % 5] += 1
for i in range(1, m + 1):
	countRemSecond[i % 5] += 1
sum = countRemFirst[0] * countRemSecond[0]
for i in range(1, 5):
	sum += countRemFirst[i] * countRemSecond[5 - i]
print(sum)


(x, y) = map(int, input().split())
arx = []
ary = []
xx = x // 5
arx = [xx, xx, xx, xx, xx]
for i in range(x % 5):
	arx[i] += 1
yy = y // 5
ary = [yy, yy, yy, yy, yy]
for i in range(y % 5):
	ary[i] += 1
sum = 0
sum += arx[0] * ary[3]
sum += arx[1] * ary[2]
sum += arx[2] * ary[1]
sum += arx[3] * ary[0]
sum += arx[4] * ary[4]
print(sum)


from sys import stdin
(n, m) = map(int, stdin.readline().strip().split())
cnt = [0 for i in range(5)]
ans = 0
for i in range(1, n + 1):
	cnt[i % 5] += 1
for i in range(1, m + 1):
	ans += cnt[-i % 5]
print(ans)


(n, m) = map(int, input().split())
res = 0
for i in range(1, n + 1):
	t1 = i // 5
	while 1:
		if 5 * t1 >= i and t1 & 1 == 1:
			break
		t1 += 1
	t1 = 5 * t1 - i
	t2 = int(str(i)[-1])
	if t1 == 0:
		t1 += 10
	if t2 != 0:
		t2 = 10 - t2
	else:
		t2 = 10
	if t1 <= m:
		res += 1
	if t2 <= m:
		res += 1
	t = m // 10
	if 10 * t + t1 <= m:
		res += t
	else:
		res += max(t - 1, 0)
	if 10 * t + t2 <= m:
		res += t
	else:
		res += max(t - 1, 0)
print(res)


(n, m) = map(int, input().split())
rem_n = [0] * 5
rem_m = [0] * 5
ans = 0
for i in range(1, n + 1):
	rem_n[i % 5] += 1
for j in range(1, m + 1):
	rem_m[j % 5] += 1
ans += rem_n[0] * rem_m[0]
ans += rem_n[2] * rem_m[3]
ans += rem_n[3] * rem_m[2]
ans += rem_n[1] * rem_m[4]
ans += rem_n[4] * rem_m[1]
print(ans)


(o, p) = map(int, input().split())
l = []
c = 0
x = min(o, p)
y = max(o, p)
for i in range(5, x + y + 1, 5):
	l.append(i)
for a in l:
	if a == x and a == y:
		c += a - 1
	elif a > x and a <= y:
		c += x
	elif a <= x and a < y:
		c += a - 1
	elif a > x and a > y:
		c += x - (a - y) + 1
print(c)


(n, m) = map(int, input().split())
a = [0] * 6
b = [0] * 6
for i in range(1, n + 1):
	a[i % 5] += 1
for i in range(1, m + 1):
	b[i % 5] += 1
s = 0
for i in range(0, 5):
	s += a[i] * b[(5 - i) % 5]
print(s)


(x, y) = map(int, input().split())
z = x // 5
a = [z] * 5
z = y // 5
b = [z] * 5
z = x % 5
for i in range(1, z + 1):
	a[i] += 1
z = y % 5
for j in range(1, z + 1):
	b[j] += 1
print(a[0] * b[0] + a[1] * b[4] + a[2] * b[3] + b[2] * a[3] + a[4] * b[1])


(x, y) = str(input()).split()
x = int(x)
y = int(y)
line_x = [x // 5] * 5
for i in range(x % 5):
	line_x[i + 1] += 1
line_y = [y // 5] * 5
for i in range(y % 5):
	line_y[i + 1] += 1
print(sum([line_x[0] * line_y[0], line_x[1] * line_y[4], line_x[2] * line_y[3], line_x[3] * line_y[2], line_x[4] * line_y[1]]))


(n, m) = map(int, input().split())
temp1 = m
temp2 = n
n = min(temp1, temp2)
m = max(temp1, temp2)
base = n // 5 * m + m // 5 * (n % 5)
for i in range(n - n % 5 + 1, n + 1):
	for j in range(m - m % 5 + 1, m + 1):
		if (i + j) % 5 == 0:
			base += 1
print(base)


from sys import stdin
input = stdin.buffer.readline

def f(a, b):
	return a // 5 + (b <= a % 5) - (b == 0)
(n, m) = map(int, input().split())
ans = 0
for i in range(5):
	ans += f(n, i) * f(m, (5 - i) % 5)
print(ans)


(n, m) = [int(i) for i in input().split()]
a = []
b = []
pair = 0
for i in range(4):
	a.append(n // 5)
	b.append(m // 5)
for i in range(n % 5):
	a[i] += 1
for i in range(m % 5):
	b[i] += 1
for i in range(4):
	pair += a[i] * b[3 - i]
pair += n // 5 * (m // 5)
print(pair)


(n, m) = map(int, input().split())
(ndiv, nmod) = divmod(n, 5)
(mdiv, mmod) = divmod(m, 5)
ncnt = [ndiv] * 5
for i in range(nmod + 1):
	ncnt[i] += 1
mcnt = [mdiv] * 5
for i in range(mmod + 1):
	mcnt[i] += 1
ncnt[0] -= 1
mcnt[0] -= 1
res = ncnt[0] * mcnt[0] + ncnt[1] * mcnt[4] + ncnt[2] * mcnt[3] + ncnt[3] * mcnt[2] + ncnt[4] * mcnt[1]
print(res)


def main():
	(n, m) = map(int, input().split())
	d = {0: 0, 1: 0, 2: 0, 3: 0, 4: 0, 5: 0}
	for i in range(1, m + 1):
		d[i % 5] += 1
	ans = 0
	for i in range(1, n + 1):
		ans += d[(5 - i % 5) % 5]
	print(ans)
main()


def main():
	(n, m) = map(int, input().split())
	print(sum(((i + n) // 5 * ((-i % 5 + m) // 5) for i in range(5))))
main()


(n, k) = list(map(int, input().split()))
so = 0
po = list(range(1, n + 1))
op = list(range(1, k + 1))
for item in po:
	ol = 0
	for l in op:
		if (item + l) % 5 == 0:
			ol = l
			break
	if ol == l:
		x = (k - ol) / 5
		if (k - ol) // 5 == (k - ol) / 5:
			so += x + 1
		else:
			so += (k - ol) // 5
			so += 1
	else:
		pass
print(int(so))


import sys
(n, m) = map(int, sys.stdin.readline().split())
res = n // 5 * (m // 5) * 5
res += n // 5 * (m % 5)
res += m // 5 * (n % 5)
for i in range(1, n % 5 + 1):
	for j in range(1, m % 5 + 1):
		if (i + j) % 5 == 0:
			res += 1
print(res)


(n, m) = (int(k) for k in input().split())
ans = 0
for x in range(1, n + 1):
	k = x % 5
	addd = int((m + k) / 5)
	if addd > 0:
		ans = ans + addd
print(ans)


(n, m) = map(int, input().split())
ans = 0
rems = [0] * m
for i in range(1, n + 1):
	yep = i % 5
	ans += (yep + m) // 5
print(ans)


(n, m) = map(int, input().split())
ans = n // 5 * 5 * (m // 5)
x = n // 5
y = m // 5
x1 = n % 5
y1 = m % 5
ans += x1 * y + y1 * x
for i in range(1, x1 + 1):
	for j in range(1, y1 + 1):
		if (i + j) % 5 == 0:
			ans += 1
print(ans)


(n, m) = map(int, input().split())
arr1 = [0] * 5
arr2 = [0] * 5
for i in range(1, n + 1):
	arr1[i % 5] += 1
for i in range(1, m + 1):
	arr2[i % 5] += 1
res = arr1[0] * arr2[0] + arr1[1] * arr2[4] + arr1[2] * arr2[3] + arr1[3] * arr2[2] + arr1[4] * arr2[1]
print(res)


l = list(map(int, input().split(' ')))
n = l[0]
m = l[1]
a = list()
b = list()
total = 0
if m >= n:
	for i in range(1, n + 1):
		a.append(i % 5)
		b.append(i % 5)
	for i in range(n + 1, m + 1):
		b.append(i % 5)
else:
	for i in range(1, m + 1):
		a.append(i % 5)
		b.append(i % 5)
	for i in range(m + 1, n + 1):
		a.append(i % 5)
if a.count(0) > 0 and b.count(0) > 0:
	total = total + a.count(0) * b.count(0)
if a.count(1) > 0 and b.count(4) > 0:
	total = total + a.count(1) * b.count(4)
if a.count(2) > 0 and b.count(3) > 0:
	total = total + a.count(2) * b.count(3)
if a.count(3) > 0 and b.count(2) > 0:
	total = total + a.count(3) * b.count(2)
if a.count(4) > 0 and b.count(1) > 0:
	total = total + a.count(4) * b.count(1)
print(total)


import math
(n, m) = map(int, input().split())
n_ = [0] * 5
m_ = [0] * 5
for i in range(1, n + 1):
	n_[i % 5] += 1
for i in range(1, m + 1):
	m_[i % 5] += 1
print(n_[1] * m_[4] + n_[2] * m_[3] + n_[3] * m_[2] + n_[4] * m_[1] + n_[0] * m_[0])


(a, b) = input().strip().split(' ')
(a, b) = [int(a), int(b)]
ans = 0
for i in range(1, a + 1):
	ans += (i % 5 + b) // 5
print(ans)


(n, m) = map(int, input().split())
count = 0
for i in range(1, n + 1):
	temp = i % 5
	req = 5 - temp
	res = (m - req) // 5
	count += res + 1
print(count)


(n, m) = map(int, input().split())
Q = []
QQ = []
for i in range(n):
	Q.append((i + 1) % 5)
for i in range(m):
	QQ.append((i + 1) % 5)
cnt = 0
cnt += Q.count(0) * QQ.count(0)
cnt += Q.count(1) * QQ.count(4)
cnt += Q.count(2) * QQ.count(3)
cnt += Q.count(3) * QQ.count(2)
cnt += Q.count(4) * QQ.count(1)
print(cnt)


(n, m) = map(int, input().split())
x = 0
y = 0
ans = 0
for x in range(1, n + 1):
	ans += (m + x % 5) // 5
print(ans)


a = input()
a = a.split()
n = int(a[0])
m = int(a[1])
(n, m) = (min(n, m), max(n, m))
ans = 0
for i in range(5, n + m + 1, 5):
	if i <= n:
		ans += i - 1
	elif i > n and i <= m:
		ans += n
	else:
		ans += n + m - i + 1
print(ans)


string = input()
numbers = string.split()
a = int(numbers[0])
b = int(numbers[1])
r1 = [a // 5 for x in range(5)]
for x in range(1, a % 5 + 1):
	r1[x] += 1
r2 = [b // 5 for x in range(5)]
for x in range(1, b % 5 + 1):
	r2[x] += 1
n = 0
for x in range(5):
	n += r1[x] * r2[(5 - x) % 5]
print(n)


class CodeforcesTask682ASolution:

	def __init__(self):
		self.result = ''
		self.n_m = []

	def read_input(self):
		self.n_m = [int(x) for x in input().split(' ')]

	def process_task(self):
		pairs = 0
		sm = min(*self.n_m)
		bg = max(*self.n_m)
		for x in range(bg // 5 * 2 + 1):
			x += 1
			a = x * 5 - 1
			if a < 0:
				a = 0
			if a > bg:
				a = bg + sm - a
			if a < 0:
				a = 0
			pairs += min(a, sm)
		self.result = str(pairs)

	def get_result(self):
		return self.result
Solution = CodeforcesTask682ASolution()
Solution.read_input()
Solution.process_task()
print(Solution.get_result())


(n, k) = map(int, input().split())
arr = [i % 5 for i in range(1, n + 1)]
ls = [i % 5 for i in range(1, k + 1)]
var = arr.count(0) * ls.count(0)
var += arr.count(1) * ls.count(4) + arr.count(4) * ls.count(1)
var += arr.count(2) * ls.count(3) + arr.count(3) * ls.count(2)
print(var)


(n, m) = map(int, input().split())
ans = [0] * 5
for i in range(1, m + 1):
	ans[i % 5] += 1
print(sum((ans[(5 - j % 5) % 5] for j in range(1, n + 1))))


def mod5(a, b):
	pairs = 0
	for x in range(1, a + 1):
		limit = b + x
		pairs += limit // 5
		pairs -= x // 5
	return pairs
(a, b) = list(map(int, input().split()))
print(mod5(a, b))


a = input()
b = a.split()
a = int(b[0])
b = int(b[1])
s = a // 5 * (b // 5)
s = s + (a / 5 + 0.8) // 1 * ((b / 5 + 0.2) // 1)
s += (a / 5 + 0.6) // 1 * ((b / 5 + 0.4) // 1)
s += (a / 5 + 0.4) // 1 * ((b / 5 + 0.6) // 1)
s += (a / 5 + 0.2) // 1 * ((b / 5 + 0.8) // 1)
print(int(s))


(n, m) = map(int, input().split())
numa = [0 for x in range(5)]
numb = [0 for x in range(5)]
for i in range(1, n + 1):
	numa[i % 5] += 1
for i in range(1, m + 1):
	numb[i % 5] += 1
ans = 0
for i in range(5):
	x = (5 - i) % 5
	ans += numb[x] * numa[i]
print(ans)


def alyona(n, m):
	if n <= m:
		ans = 0
		for i in range(1, n + 1):
			a = i // 5
			ans += (m + i) // 5 - a
	else:
		ans = 0
		for i in range(1, m + 1):
			a = i // 5
			ans += (n + i) // 5 - a
	return ans
(n, m) = list(map(int, input().split(' ')))
print(alyona(n, m))


(n, m) = map(int, input().split())
if n > m:
	(n, m) = (m, n)
total = 0
for i in range(1, n + 1):
	total += (m - 5 + i % 5) // 5 + 1
print(total)


import sys
RI = lambda : [int(x) for x in sys.stdin.readline().split()]
ri = lambda : sys.stdin.readline().strip()

def input():
	return sys.stdin.readline().strip()

def list2d(a, b, c):
	return [[c] * b for i in range(a)]

def list3d(a, b, c, d):
	return [[[d] * c for j in range(b)] for i in range(a)]

def list4d(a, b, c, d, e):
	return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]

def ceil(x, y=1):
	return int(-(-x // y))

def INT():
	return int(input())

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

def LIST(N=None):
	return list(MAP()) if N is None else [INT() for i in range(N)]

def Yes():
	print('Yes')

def No():
	print('No')

def YES():
	print('YES')

def NO():
	print('NO')
INF = 10 ** 18
MOD = 10 ** 9 + 7
(n, m) = RI()
lis1 = [0] * 5
lis2 = [0] * 5
for i in range(5):
	lis1[i] = n // 5
	lis2[i] = m // 5
	lis1[i] += 1 if n % 5 >= i and i != 0 else 0
	lis2[i] += 1 if m % 5 >= i and i != 0 else 0
ans = 0
for i in range(5):
	ans += lis1[i] * lis2[(5 - i) % 5]
print(ans)


(x, y) = [int(x) for x in input().split()]
c = 0
for i in range(1, x + 1):
	c += (y + i % 5) // 5
print(c)


def MakeArray(X):
	Temp = [X // 5] * 5
	for i in range(1, X % 5 + 1):
		Temp[i] += 1
	return Temp
Num = list(map(int, input().split()))
(First, Second) = (MakeArray(Num[0]), MakeArray(Num[1]))
print(First[0] * Second[0] + sum((i * j for (i, j) in zip(First[1:], Second[1:][::-1]))))


import sys

def div(n, k):
	if k == 0:
		return n // 10
	return n // 10 + (1 if n % 10 >= k else 0)

def main(n, m):
	s = 0
	for i in range(10):
		nums = div(n, i)
		l1 = (10 - i) % 10
		l2 = (5 - i) % 10
		if l1 == l2:
			s += nums * div(m, l1)
		else:
			s += nums * div(m, l1)
			s += nums * div(m, l2)
	print(s)
arr = []
for (e, line) in enumerate(sys.stdin.readlines()):
	arr = list(map(int, line.strip().split()))
main(*arr)


(n, m) = list(map(int, input().split()))
sol = 0
for i in range(5):
	sol += (n + (5 - i) % 5) // 5 * ((m + i) // 5)
print(sol)


(n, m) = map(int, input().split())
fre1 = [0] * 7
fre2 = [0] * 7
l = 1
for i in range(min(n, m)):
	fre1[l % 5] += 1
	fre2[l % 5] += 1
	l += 1
while l <= n:
	fre1[l % 5] += 1
	l += 1
while l <= m:
	fre2[l % 5] += 1
	l += 1
res = fre1[0] * fre2[0]
for i in range(4):
	res += fre1[i + 1] * fre2[5 - i - 1]
print(res)


(n, m) = map(int, input().split())
(mini, maxi) = (min(n, m), max(n, m))
count = 0
for i in range(1, mini + 1):
	count += (i + maxi) // 5 - i // 5
print(count)