a,b=map(int,input().split()) s=set() for i in range(a+1): for j in range(b+1): a=i+5*j s.add(a) s.remove(0) print(len(s))