long,eat=map(int,input().split()) ceat=(long-1)/(eat*2) print(int(ceat)*eat)