Subset of Five
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
64bit IO Format: %lld

题目描述

"Today is another day! I'm five." With the fail of unit tests, XiaoYang tiredly lies on the sofa. As we all know, XiaoYang is not good at implementing algorithms. The unit test is for a subset searching algorithm. Here is the task.

You are given a set A with n **distinct** integers . You should find a "five" subset S, so that the sum of numbers in S is maximized and the sum is divisible by 5. A set of size m is called the subset of set when holds for and all integers in B are distinct.

输入描述:

The first line contains integer , the size of set A.

The second line contains n integers .


输出描述:

Output the maximal sum of S.
示例1

输入

复制
5
2 10 6 3 1

输出

复制
20