Under construction

Still being built. Things may change

Union Maplestory

Time limit1sMemory limit1024 MB

Summary
Given each character's level, sum the levels of the top 42 characters by level and the stat gains from reaching levels 60, 100, 140, 200, and 250.
Level

Easy2 of 10

Topics
Sorting, Implementation
Solved
No attempts yet

Problem

Maplestory has a system called Union, and each level raises a character's stats. For a regular character, the stats go up by 11 at levels 6060, 100100, 140140, 200200, and 250250.

Sort the characters by level from highest to lowest. The Union raid party is made of the first 4242 characters in that order. If the number of characters is less than 4242, every character joins the Union raid party.

You are given NN, the number of characters Ims owns, and the level of each character. Print the sum of the levels of the characters in Ims's raid party and the sum of the stat increases they gained.

Input

The first line contains N(1≤N≤100)N(1 \leq N \leq 100), the number of characters Ims owns.

From the second line onward, each of the next NN lines contains one character's level L(1≤L≤300)L(1 \leq L \leq 300).

Output

Print the sum of the levels and the sum of the stat increases for the characters in Ims's raid party, separated by a space.

Examples2

  1. Example 1

    Input
    3
    266
    246
    238
    
    Expected output
    750 13
    
  2. Example 2

    Input
    5
    250
    200
    140
    100
    60
    
    Expected output
    750 15