Bouquet of Flowers for Juniors#11113

Bouquet of Flowers for Juniors

1 second
128 megabytes
Very easy

Since today is March 8th, you will be preparing a bouquet of flowers. There are two kinds of flowers in your store. White and red flowers. Each bouquet must consist of flowers, and the bouquet must contain both types of flowers.

If your store has white and red flowers, what is the maximum number of bouquets you can make?

Input

Two integers and (0 ≤ n, m ≤ 5 \cdot 10^5).

Output

Print the maximum number of bouquets you can make.

Examples

Example 1

Loading
Loading