a, b = map(int, raw_input().split())
day = 0
while a > 0:
    day, a = day + 1, a - 1
    if day % b == 0:
        a += 1
print day
                                                                                                                               