LearnPy Hub
← Arena
EasyRating 900

Running Out of Socks

You have n pairs of socks and use one pair a day. Every m-th day your mum buys one new pair in the evening. How many days in a row can you wear socks?

Input

Two integers n and m (1 ≤ n ≤ 100, 2 ≤ m ≤ 100).

Output

One integer.

Sample 1

Input
2 2
Output
3

Sample 2

Input
9 3
Output
13
solution.py
Output appears here
Running Out of Socks · Python Arena problem · LearnPy Hub