"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.