#include <bits/stdc++.h> using namespace std; int main() { int x, n; cin >> x >> n; long long s = 0; for (int i = 1; i <= n; i++) { if (x > 7) { x == 1; } if (x != 6 && x != 7) { s += 250; } x++; } cout << s; return 0; }