L,K = map(int,input().split()) K2 = 2 * K s = 0 n = 0 while s < L: s += K2 n += 1 #print(s) print((n-1)*K)