| IV DCC CODE CUP |
|---|
| Finished |
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.
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.
Print a single integer: the maximum number of roads Fred can build.
8 3
4
4 0
0
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.
| Name |
|---|


