

Time Limit: 2 sec / Memory Limit: 256 MB
配点: 点
問題文
AtCoder 王国では, 月 日のような月の数と日の数が同じ日を「高橋」と言う.
年 月 日から 年 月 日までに, 「高橋」は何日あるか.
ただし, AtCoder 王国ではグレゴリオ暦を利用しているものとする.
制約
- は 以上 以下の整数
- は 以上 以下の整数
- 年 月 日はグレゴリオ暦において正しい日付である.
入力
入力は以下の形式で標準入力から与えられる.
出力
年 月 日から 年 月 日までに「高橋」は何日あるか、出力しなさい。
入力例 1Copy
5 5
出力例 1Copy
5
月 日, 月 日, 月 日, 月 日, 月 日, 合計 日が「高橋」です.
入力例 2Copy
2 1
出力例 2Copy
1
月 日のみが「高橋」です.
入力例 3Copy
11 30
出力例 3Copy
11
, , , , , , , , , , の, 合計 日です.
Score: points
Problem Statement
In AtCoder Kingdom, Gregorian calendar is used, and dates are written in the "year-month-day" order, or the "month-day" order without the year.
For example, May , is written as --, or - without the year.
In this country, a date is called Takahashi when the month and the day are equal as numbers. For example, - is Takahashi.
How many days from -- through -- are Takahashi?
Constraints
- is an integer between and (inclusive).
- is an integer between and (inclusive).
- -- is a valid date in Gregorian calendar.
Input
Input is given from Standard Input in the following format:
Output
Print the number of days from -- through -- that are Takahashi.
Sample Input 1Copy
5 5
Sample Output 1Copy
5
There are five days that are Takahashi: -, -, -, - and -.
Sample Input 2Copy
2 1
Sample Output 2Copy
1
There is only one day that is Takahashi: -.
Sample Input 3Copy
11 30
Sample Output 3Copy
11
There are eleven days that are Takahashi: -, -, -, -, -, -, -, -, -, - and -.