#include using namespace std; const long long INF = 1LL << 60; #define MOD 1000000007; typedef long long ll; #define writeln(n) cout< P; typedef pair Psi; int a[24]; int b[24]; int main() { int l,k; cin>>l>>k; int cnt = l/2*k; if(cnt !=0){ if(l%k ==0){ cnt--; } } writeln(k*cnt); }