def main(): L, K = map(int, input().split()) print(L//(2*K) + K) if __name__ == "__main__": # {{{ try: import test test.test() except: main() # }}}