input_list = list(map(int,input().split())) l = input_list[0] k = input_list[1] rest = l yu = 0 while 2*k < rest: yu += k rest -= 2*k print(yu)