100 atcoder#ABC185A. [ABC185A] ABC Preparation
[ABC185A] ABC Preparation
Score : points
Problem Statement
Takahashi has decided to hold some number of programming contests. Holding one contest requires one -point problem, one -point problem, one -point problem, and one -point problem. When he has , , , and drafts of -, -, -, and -point problems, respectively, at most how many contests can he hold? The same draft can be used only once.
Constraints
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
$A_1 \hspace{7pt} A_2 \hspace{7pt} A_3 \hspace{7pt} A_4$
Output
Print an integer representing the maximum number of contests that can be held.
5 3 7 11
3
By using three drafts for each slot, he can hold three contests. He has just three drafts for -point problems, so he cannot hold four.
100 100 1 100
1
A contest cannot be held even if there is just one missing slot.