a,b=map(int,input().split(" ")) s=0 for i in range(a,a+b+1): if not(i%7==6 or i%7==0): s+=250 print(s)