eolymp
bolt
Try our new interface for solving problems
Problems

Bouquet of Flowers for Juniors

Bouquet of Flowers for Juniors

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 $3$ flowers, and the bouquet must contain both types of flowers.

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

Input

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

Output

Print the maximum number of bouquets you can make.

Time limit 1 second
Memory limit 128 MiB
Input example #1
88 100
Output example #1
62
Source 2022 Azerbaijan Republic Olympiad, Semifinals, March 8