aaa,bbb = map(int, raw_input().split(" ")) ans = 0 while(1): if aaa - 2*bbb > 0: ans = ans + bbb else: break aaa = aaa - 2*bbb print ans