Limiting Fruitactants


Submit solution

Points: 3
Time limit: 1.0s
Memory limit: 256M

Authors:
Problem type

Johnny has a big problem. He knows he has \(A\) apples and \(B\) bananas and he wants to make as many fruit salads as possible. Each fruit salad requires \(1\) apple and \(2\) bananas. Unfortunately, Johnny is not very good at math. Can you help Johnny figure out the maximum number of fruit salads he can make?

Constraints

\(0 \le A \le 1000\)

\(0 \le B \le 2000\)

Input Specifications

The first line contains the integer \(A\), the number of apples Johnny has.
The second line contains the integer \(B\), the number of bananas Johnny has.

Output Specification

Output one integer, \(N\), the maximum number of fruit salads Johnny can make.

Sample Input

19
32

Sample Output

16

Explanation for Sample Output

Johnny can make \(16\) fruit salads using \(16\) apples and \(32\) bananas.


Comments

There are no comments at the moment.