#D497. Day of Takahashi

    ID: 407 Type: Default 2000ms 268MiB

Day of Takahashi

Day of Takahashi

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 3, 2018 is written as 2018-5-3, or 5-3 without the year.

In this country, a date is called Takahashi when the month and the day are equal as numbers. For example, 5-5 is Takahashi. How many days from 2018-1-1 through 2018-a-b are Takahashi?

Constraints

  • a is an integer between 1 and 12 (inclusive).
  • b is an integer between 1 and 31 (inclusive).
  • 2018-a-b is a valid date in Gregorian calendar.

Input

Input is given from Standard Input in the following format:

a b

Output

Print the number of days from 2018-1-1 through 2018-a-b that are Takahashi.

Examples

Input

5 5

Output

5

Input

2 1

Output

1

Input

11 30

Output

11

inputFormat

Input

Input is given from Standard Input in the following format:

a b

outputFormat

Output

Print the number of days from 2018-1-1 through 2018-a-b that are Takahashi.

Examples

Input

5 5

Output

5

Input

2 1

Output

1

Input

11 30

Output

11

样例

11 30
11