import math def main(): l, k = map(int, input().split()) if l/2 > k: print(round(((l/2)//k)*k)) else: print(0) if __name__ == '__main__': main()