#include <iostream>
#include <cmath>
using namespace std;
int main() {
long long N, P;
cin >> N >> P;
double h, l, d, lenta, price;
h = (1+N)*N*0.5;
l = 0.5 + N*0.5;
d = sqrt(h*h + l*l);
lenta = ceil(d + d + 1);
price = lenta * P;
if (price >= 1000) {
price *= 85;
}
else if (price >= 100) {
price *= 90;
}
else {
price *=100;
}
if (ceil(100./P) > lenta and price > 90*ceil(100./P)*P){
price = 90*ceil(100./P)*P;
}
else if (ceil(1000./P) > lenta and price > 85*ceil(1000./P)*P) {
price = 85*ceil(1000./P)*P;
}
cout << price;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8Y21hdGg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgppbnQgbWFpbigpIHsKCWxvbmcgbG9uZyBOLCBQOwoJY2luID4+IE4gPj4gUDsKCWRvdWJsZSBoLCBsLCBkLCBsZW50YSwgcHJpY2U7CgloID0gKDErTikqTiowLjU7CglsID0gMC41ICsgTiowLjU7CglkID0gc3FydChoKmggKyBsKmwpOwoJbGVudGEgPSBjZWlsKGQgKyBkICsgMSk7CglwcmljZSA9IGxlbnRhICogUDsKCWlmIChwcmljZSA+PSAxMDAwKSB7CgkJcHJpY2UgKj0gODU7Cgl9CgllbHNlIGlmIChwcmljZSA+PSAxMDApIHsKCQlwcmljZSAqPSA5MDsKCX0KCWVsc2UgewoJCXByaWNlICo9MTAwOwoJfQoJaWYgKGNlaWwoMTAwLi9QKSA+IGxlbnRhIGFuZCBwcmljZSA+IDkwKmNlaWwoMTAwLi9QKSpQKXsKCQlwcmljZSA9IDkwKmNlaWwoMTAwLi9QKSpQOwoJfQoJZWxzZSBpZiAoY2VpbCgxMDAwLi9QKSA+IGxlbnRhIGFuZCBwcmljZSA+IDg1KmNlaWwoMTAwMC4vUCkqUCkgewoJCXByaWNlID0gODUqY2VpbCgxMDAwLi9QKSpQOwoJfQoJY291dCA8PCBwcmljZTsKfQ==