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 Rust (1.15.1) (judge verdict: Accepted)

fn main() {
    let mut input_buffer = String::with_capacity(cpio::BUFFER_SIZE);
    let mut output_buffer = Vec::with_capacity(cpio::BUFFER_SIZE);
    unsafe {
        cpio::input::buf = &mut output_buffer;
        cpio::output::buf = &mut input_buffer;
    }
    std::thread::Builder::new()
        .stack_size(104_857_600)
        .spawn(solve)
        .unwrap()
        .join()
        .unwrap();
    cpio::output::flush();
}

#[macro_use]
#[allow(dead_code, non_upper_case_globals, unused_macros)]
mod cpio {
    pub const BUFFER_SIZE: usize = 8192;
    #[macro_use]
    pub mod output {
        pub const ENABLE_DUMP: bool = true;
        pub const PRECISION: usize = 10;
        pub static mut buf: *mut String = 0 as *mut String;

        macro_rules! p {
            ($x: expr) => {{
                $x.output();
                '\n'.output();
                unsafe {
                    if (*cpio::output::buf).len() > cpio::BUFFER_SIZE {
                        flush();
                    }
                }
            }};
            ($x: expr, $($y: expr),+) => {{
                $x.output();
                ' '.output();
                p!($($y),+);
            }};
        }

        macro_rules! pf {
            ($($x: expr),+) => {{
                p!($($x),+);
                flush();
            }};
        }

        macro_rules! d {
            ($($a: expr),+) => {
                if ENABLE_DUMP {
                    use std::io::*;
                    write!(stderr(), "{}:{}\t", file!(), line!()).unwrap();
                    d!(A $($a),+);
                    write!(stderr(), " = ").unwrap();
                    d!(B $($a),+);
                    write!(stderr(), "\n").unwrap();
                    stderr().flush().unwrap();
                }
            };
            (A $x: expr) => {
                write!(stderr(), "{}", stringify!($x)).unwrap();
            };
            (A $x: expr, $($y: expr),+) => {
                write!(stderr(), "{}, ", stringify!($x)).unwrap();
                d!(A $($y),+);
            };
            (B $x: expr) => {
                write!(stderr(), "{:?}", $x).unwrap();
            };
            (B $x: expr, $($y: expr),+) => {
                write!(stderr(), "{:?}, ", $x).unwrap();
                d!(B $($y),+);
            };
        }

        pub trait Output {
            fn output(&self);
        }

        macro_rules! output_normal {
            ($t: ty) => {
                impl Output for $t {
                    fn output(&self) {
                        unsafe {
                            use std::fmt::Write;
                            write!(&mut *buf, "{}", self).unwrap();
                        }
                    }
                }
            };
            ($t: ty, $($u: ty),+) => {
                output_normal!($t);
                output_normal!($($u),+);
            };
        }

        macro_rules! output_float {
            ($t: ty) => {
                impl Output for $t {
                    fn output(&self) {
                        unsafe {
                            use std::fmt::Write;
                            write!(&mut *buf, "{:.*}", PRECISION, self).unwrap();
                        }
                    }
                }
            };
            ($t: ty, $($u: ty),+) => {
                output_float!($t);
                output_float!($($u),+);
            };
        }

        pub fn flush() {
            unsafe {
                print!("{}", *buf);
                use std::io::*;
                stdout().flush().unwrap();
                (*buf).clear();
            }
        }

        output_normal!(u8, u16, u32, u64, usize, char);
        output_normal!(i8, i16, i32, i64, isize);
        output_normal!(bool, &'static str, String);
        output_float!(f32, f64);
    }

    pub mod input {
        pub trait Input<T> {
            fn input() -> T;
        }

        macro_rules! input_primitive {
            ($t: ty) => {
                impl Input<$t> for $t {
                    fn input() -> $t {
                        get_word().expect("EOF?").parse()
                            .unwrap_or_else(|e| panic!("Parse error : {}", e))
                    }
                }
            };
            ($t: ty, $($u: ty),+) => {
                input_primitive!($t);
                input_primitive!($($u),+);
            };
        }

        macro_rules! input_tuple {
            ($($t: ident),*) => {
                impl< $($t: Input<$t>),* > Input< ( $($t),* ) > for ( $($t),* ) {
                    fn input() -> ( $($t),* ) {
                        ( $( $t::input()),* )
                    }
                }
            };
        }

        input_primitive!(u8, u16, u32, u64, usize);
        input_primitive!(i8, i16, i32, i64, isize);
        input_primitive!(bool, String);
        input_tuple!(A, B);
        input_tuple!(A, B, C);
        input_tuple!(A, B, C, D);

        pub fn get<T: Input<T>>() -> T {
            T::input()
        }

        pub fn get_vec<T: Input<T>>(n: usize) -> Vec<T> {
            (0..n).map(|_| get()).collect()
        }

        pub fn get_mat<T: Input<T>>(r: usize, c: usize) -> Vec<Vec<T>> {
            (0..r).map(|_| get_vec(c)).collect()
        }

        pub fn get_vec_char() -> Vec<char> {
            get_word().unwrap().chars().collect()
        }

        pub fn get_mat_char(h: usize) -> Vec<Vec<char>> {
            (0..h).map(|_| get_vec_char()).collect()
        }

        pub fn get_line() -> String {
            get_line_wrapped().unwrap()
        }

        fn get_word() -> Option<String> {
            let mut res = String::with_capacity(18);
            while let Some(c) = get_u8() {
                let d = c as char;
                if !d.is_whitespace() {
                    res.push(d);
                } else if res.len() != 0 {
                    unget_u8(c);
                    break;
                }
            }
            if res.len() == 0 { None } else { Some(res) }
        }

        fn get_line_wrapped() -> Option<String> {
            let c = get_u8();
            if c.is_none() {
                return None;
            }
            let mut line = String::with_capacity(18);
            line.push(c.unwrap() as char);
            loop {
                let c = get_u8();
                if c.is_none() || c.unwrap() == b'\n' {
                    // コメントはC++等での仕様
                    // if c.is_some() {
                    //     self.unget_u8(b'\n');
                    // }
                    return Some(line);
                }
                line.push(c.unwrap() as char);
            }
        }

        pub fn has_next() -> bool {
            loop {
                let c = get_u8();
                if c.is_none() {
                    return false;
                }
                let c = c.unwrap();
                if !(c as char).is_whitespace() {
                    unget_u8(c);
                    return true;
                }
            }
        }

        pub static mut buf: *mut Vec<u8> = 0 as *mut Vec<u8>;

        fn get_u8() -> Option<u8> {
            unsafe {
                let b = &mut (*buf);
                use std::io::{stdin, Read};
                if let Some(c) = b.pop() {
                    Some(c as u8)
                } else {
                    b.resize(super::BUFFER_SIZE, 0);
                    match stdin().read(b) {
                        Ok(l) if l > 0 => {
                            b.truncate(l);
                            b.reverse();
                            b.pop()
                        }
                        _ => {
                            b.clear();
                            return None;
                        }
                    }
                }
            }
        }

        fn unget_u8(c: u8) {
            unsafe { (*buf).push(c) }
        }
    }
}

#[allow(unused_imports)]
use cpio::input::*;
#[allow(unused_imports)]
use cpio::output::*;

fn solve() {
    while has_next() {
        let n = get();
        let v = get_vec::<u32>(n);
        let mut cnt = [0; 10];
        let thr = [1,400,800,1200,1600,2000,2400,2800,3200,5000];
        for x in v {
            let mut i = 0;
            while thr[i] <= x {
                i += 1;
            }
            cnt[i] += 1;
            // d!(i, x);
        }
        // d!(cnt);
        let mut k = 0;
        for i in 0..9 {
            if cnt[i] != 0 {
                k += 1;
            }
        }
        if cnt[9] == 0 {
            p!(k, k);
        } else {
            p!(std::cmp::max(k, 1), k + cnt[9]);
        }
    }
}