L,K = map(int,input().split()) print(K * ((L - 1) // (K * 2)))