Mr. Cai loves to tell some jokes to TT.
As Mr. Cai don't have too much jokes, he may tell one joke again and again.
Fortunately, TT's memory is not that good. That means she can only remember recently M 'new jokes'. Even if she remembered one joke, she won't deepen impression for this joke.
Mr. Cai tell one joke per day. And during N days, can you calculate out how many 'new jokes' TT has heard?
For each case, you should output the number of 'new jokes' that TT has heard during those days.