L , K = map(int , input().split()) if (L // K)/2 == 1 : print(0) else : print(int(((L // K)//2)*K))