eolymp
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 (0n, m5 * 105).

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