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