# -*- coding: utf-8 -*- __author__ = 'yuuki' #No.63 ポッキーゲーム L,K = map(int,raw_input().split()) C = (L - 1) / (K * 2) print C * K