import fileinput

a = -1
b = -1
for line in fileinput.input():
  lineList = line.split()
  a = float(lineList[0])
  b = float(lineList[1])
burntOut = 0
hours = 0
while True:
  if (a <= 0):
    break
  a -= 1
  burntOut += 1;
  hours += 1;
  if (burntOut >= b):
    a += 1
    burntOut = 0
print hours