B. Catan
time limit per test
1 second
memory limit per test
1024 megabytes
input
standard input
output
standard output

Fred is a professional Catan player. In this board game, players collect resources to build cities and roads. After so many games, he is confident he could find a job in construction if he ever wanted a career change. Today, he wants to broaden his experience by building as many roads as possible!

To build a road, Fred must spend one lumber card and one brick card. He currently has $$$m$$$ lumber cards and $$$t$$$ brick cards. If he runs short of either resource, he can trade with the bank: four lumber cards for one brick card, or four brick cards for one lumber card. He may make as many of these trades as he likes.

Help Fred determine the maximum number of roads he can build using his cards and these trades.

Input

The input consists of one line containing two integers $$$m$$$ and $$$t$$$ ($$$0 \le m,t \le 10^{9}$$$), Fred's numbers of lumber and brick cards, respectively.

Output

Print a single integer: the maximum number of roads Fred can build.

Examples
Input
8 3
Output
4
Input
4 0
Output
0
Note

Explanation for example 1

Fred builds three roads, trades four lumber cards for one brick card, and builds a fourth road.

Explanation for example 2

If Fred trades all four lumber cards, he will have no lumber left to build a road.