from decimal import * import math n,k=map(Decimal,input().split()) a=n-(n/(k+1))*k print(math.ceil(a))