QOJ.ac

QOJ

実行時間制限: 1 s メモリ制限: 128 MB 満点: 100

#4849. Watermelons

統計

Mirko is in charge of bringing watermelons to the beach. He bought $A$ watermelons weighing $5\text{ kg}$ each, $B$ watermelons weighing $4\text{ kg}$ each, $C$ watermelons weighing $3\text{ kg}$ each, $D$ watermelons weighing $2\text{ kg}$ each, and $E$ watermelons weighing $1\text{ kg}$ each. To carry these watermelons, he will use bags that have a maximum load capacity of $5\text{ kg}$.

It is necessary to determine the minimum number of bags Mirko needs to buy to carry all the watermelons.

Mirko will carry as many watermelons in each bag as possible without exceeding the capacity, he will not cut the watermelons into smaller pieces, and he will not put bags inside other bags.

Input

The first line contains five integers from the problem description $A, B, C, D,$ and $E$ ($0 \le A, B, C, D, E \le 1000$).

Output

In the first and only line, write the number of bags Mirko needs to buy.

Examples

Input 1

5 0 0 0 0

Output 1

5

Input 2

0 0 0 0 5

Output 2

1

Input 3

0 10 0 10 3

Output 3

15

Input 4

1 1 5 4 3

Output 4

7

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.