Contest Duration: - (local time) (100 minutes) Back to Home
A - ABC Preparation /

Time Limit: 2 sec / Memory Limit: 1024 MB

### 問題文

コンテストを 1 回開くには、100 点問題、200 点問題、300 点問題、400 点問題が 1 問ずつ必要です。
100, 200, 300, 400 点問題の案がそれぞれ A_1, A_2, A_3, A_4 個あるとき、コンテストを最大で何回開けるでしょうか？
なお、同じ問題案は 1 度しか使えません。

### 制約

• 1 \le A_i \le 100 (1 \le i \le 4)
• 入力は全て整数

### 入力

A_1 \hspace{7pt} A_2 \hspace{7pt} A_3 \hspace{7pt} A_4


### 出力

コンテストを開催可能な最大回数を表す整数を出力せよ。

### 入力例 1

5 3 7 11


### 出力例 1

3


100, 200, 300, 400 点問題の案を 3 つずつ使って、コンテストを 3 回開くことができます。
200 点問題の案が 3 つしかないため、4 回開くことはできません。

### 入力例 2

100 100 1 100


### 出力例 2

1


Score : 100 points

### Problem Statement

Takahashi has decided to hold some number of programming contests.
Holding one contest requires one 100-point problem, one 200-point problem, one 300-point problem, and one 400-point problem.
When he has A_1, A_2, A_3, and A_4 drafts of 100-, 200-, 300-, and 400-point problems, respectively, at most how many contests can he hold?
The same draft can be used only once.

### Constraints

• 1 \le A_i \le 100 (1 \le i \le 4)
• 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.

### Sample Input 1

5 3 7 11


### Sample Output 1

3


By using three drafts for each slot, he can hold three contests. He has just three drafts for 200-point problems, so he cannot hold four.

### Sample Input 2

100 100 1 100


### Sample Output 2

1


A contest cannot be held even if there is just one missing slot.