Problem:
Score : 300 points

Problem Statement

In AtCoder, a person who has participated in a contest receives a color, which corresponds to the person's rating as follows:

Rating 1-399 : gray

Rating 400-799 : brown

Rating 800-1199 : green

Rating 1200-1599 : cyan

Rating 1600-1999 : blue

Rating 2000-2399 : yellow

Rating 2400-2799 : orange

Rating 2800-3199 : red

Other than the above, a person whose rating is 3200 or higher can freely pick his/her color, which can be one of the eight colors above or not.

Currently, there are N users who have participated in a contest in AtCoder, and the i-th user has a rating of a_i.

Find the minimum and maximum possible numbers of different colors of the users.

Constraints

1 ≤ N ≤ 100

1 ≤ a_i ≤ 4800

a_i is an integer.

Input

Input is given from Standard Input in the following format:

N
a_1 a_2 ... a_N

Output

Print the minimum possible number of different colors of the users, and the maximum possible number of different colors, with a space in between.

Sample Input 1

4
2100 2500 2700 2700

Sample Output 1

2 2

The user with rating 2100 is "yellow", and the others are "orange". There are two different colors.

Sample Input 2

5
1100 1900 2800 3200 3200

Sample Output 2

3 5

The user with rating 1100 is "green", the user with rating 1900 is blue and the user with rating 2800 is "red".

If the fourth user picks "red", and the fifth user picks "blue", there are three different colors. This is one possible scenario for the minimum number of colors.

If the fourth user picks "purple", and the fifth user picks "black", there are five different colors. This is one possible scenario for the maximum number of colors.

Sample Input 3

20
800 810 820 830 840 850 860 870 880 890 900 910 920 930 940 950 960 970 980 990

Sample Output 3

1 1

All the users are "green", and thus there is one color.

Solution in JavaScript (node.js v5.12) (judge verdict: Accepted)

function myin(){return require("fs").readFileSync("/dev/stdin", "utf8").trim();}
function myout(t){console.log(t);}//standard output
function myerr(t){console.error(t);}//standard error
//[no]param
//0:何もしない  1:数値へ変換  2:半角SPで分割  3:改行で分割  4:半角SPで分割し、数値配列へ
//5:改行で分割し、数値配列へ  6:1文字に分割  7:1文字に分割し、数値配列へ
function myconv(i,no){switch(no){case 0:return i;case 1:return parseInt(i);case 2:return i.split(" ");case 3:return i.split("\n");case 4:return i.split(" ").map((a)=>Number(a));case 5:return i.split("\n").map((a)=>Number(a));case 6:return i.split("");case 7:return i.split("").map((a)=>Number(a));}}
function Main(input) {
  input = myconv(input,3);
  var N = myconv(input[0],1);
  var list = myconv(input[1],4);
  var set = {
  	"gray" : false,
    "brown" : false,
    "green" : false,
    "water" : false,
    "blue" : false,
    "yellow" : false,
    "orange" : false,
    "red" : false,
    "all" : 0
  };
  var notall = 0;
  for(var i = 0; i < N; i++){
    if(list[i] >=1 && list[i] <= 399 && !set["gray"]){
       set["gray"] = true;
      notall++;
    }
    if(list[i] >=400 && list[i] <= 799 && !set["brown"]){
       set["brown"] = true;
      notall++;
    }
    if(list[i] >=800 && list[i] <= 1199 && !set["green"]){
       set["green"] = true;;
      notall++;
    }
    if(list[i] >=1200 && list[i] <= 1599 && !set["water"]){
       set["water"] = true;
      notall++;
    }
    if(list[i] >=1600 && list[i] <= 1999 && !set["blue"]){
       set["blue"] = true;
      notall++;
    }
    if(list[i] >=2000 && list[i] <= 2399 && !set["yellow"]){
       set["yellow"] = true;
      notall++;
    }
    if(list[i] >=2400 && list[i] <= 2799 && !set["orange"]){
       set["orange"] = true;
      notall++;
    }
    if(list[i] >=2800 && list[i] <= 3199 && !set["red"]){
       set["red"] = true;
      notall++;
    }
    if(list[i] >=3200){
       set["all"]++;
    }
  }
  myerr(set);
  var min = notall;
  var max = notall + set["all"];
  if(min == 0 && set["all"] >=1){
     min = 1;
  }
  myout(min + " " + max);
}
Main(myin());