#include<bits/stdc++.h>
using namespace std;
int main(){
long long x,n,r = 0,i;
cin>>x>>n;
for(i = x;i <= x + n - 1;i++){
if(i % 7 != 6 && i % 7 != 0){
r = r + 250;
}
}
cout<<r<<endl;
}
/**************************************************************
Problem: 1468
User: linmiaoling
Language: C++
Result: Accepted
Time:16 ms
Memory:2072 kb
****************************************************************/