x, n = map(int, input().strip().split()) Sum = 0 if n == 0: Sum = 0 else: for i in range(x, x+n+1): if 0 < i % 7 < 6: Sum += 1 print(250*Sum)