"use strict"
function main(arg) {
    let [a,b] = arg.trim().split("\n")[0].split(" ").map(Number)
    // console.log(Math.floor(a*b))
    let a1 = BigInt(a * Math.floor(b))
    let a2 = BigInt(Math.floor((b - Math.floor(b)) * a))
    let a3 = a1 + a2
    console.log(Number(a3))
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
