# your code goes here L,K=map(int, input().split()) i=0 Y=0 K2=2*K #rint(K2) while L>K2: L-=K2 Y+=K print(Y)