#include <iostream> using namespace std; int main(){ int x,n; cin>>x>>n; cout<<250*n-(n/7)*250*2<<endl; return 0;