length, kajiru = map(int, input().split()) yu_eat = 0 while kajiru*2 < length: yu_eat = yu_eat + kajiru length = length - kajiru*2 print(yu_eat)