def main(): l,k = map(int,input().split()) length = l eat = 0 while(length>k*2): eat += k length -= k*2 print(eat) if __name__ == '__main__': main()