a, b = map(int, input().split())
n = 0
for i in range(a, b + 1):
    ii = sum(list(map(int, list(str(i))))) # 现将数字转换成str再转成list再用map将元素转成int在将map对象转成list再用sum函数累加返回int
    if ii % 5 == 0 and ii >= 5:
        n += 1
print(n)