import sys input=lambda: sys.stdin.readline().rstrip() l,k=map(int,input().split()) print(k*((l-1)//(2*k)))