hour=int(input())
rate=int(input())
if hour<0 or rate<0:
 print("Lỗi nhập dữ liệu")
else:
 if hour<=40:
  tien=hour*rate
 else:
  tien=40*rate+(hour-40)*rate*1.5
print(tien)