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