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 C# (.NET Core 3.1.201) (judge verdict: Accepted)

using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Linq;
using System.Numerics;
using System.Runtime.Serialization.Formatters.Binary;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
using System.Threading.Tasks;

static class MainClass
{
    private static Scanner scanner;
    public static void Main()
    {
        scanner = new Scanner();
        Solve();
        // for scanner bug
        scanner.Next();
    }

    private static void Solve()
    {
        //1344
        var N = scanner.NextInt();
        var ls = new List<int>();
        var hashTable = new HashSet<int>();
        var isOutCount = 0;
        for (int i = 0; i < N; i++)
        {
            var a = scanner.NextInt();
            ls.Add(a);
            if (a >= 3200)
            {
                isOutCount++;
            }
            else
            {
                hashTable.Add(a / 400);
            }
        }

        if (isOutCount > 0)
        {
            Console.WriteLine($"{(hashTable.Count == 0 ? 1 : hashTable.Count)} {hashTable.Count + isOutCount}");
        }
        else
        {
            Console.WriteLine($"{hashTable.Count} {hashTable.Count}");
        }

    }


    private static int UpperBound<T>(this IEnumerable<T> list, T item) where T : IComparable<T> => UpperBound(list.ToList(), item);
    private static int LowerBound<T>(this IEnumerable<T> list, T item) where T : IComparable<T> => LowerBound(list.ToList(), item);

    private static int UpperBound<T>(this List<T> list, T item) where T : IComparable<T>
    {
        return list.BinarySearch(item, -1, list.Count, (first, second) => first.CompareTo(second) > 0);
    }

    private static int LowerBound<T>(this List<T> list, T item) where T : IComparable<T>
    {
        return list.BinarySearch(item, -1, list.Count, (first, second) => first.CompareTo(second) >= 0);
    }

    private static int BinarySearch<T>(this List<T> list, T item, int left, int right, Func<T, T, bool> isOkPredicate)
    {
        while (Math.Abs(right - left) > 1)
        {
            var mid = left + (right - left) / 2;
            if (isOkPredicate(list[mid], item))
            {
                right = mid;
            }
            else
            {
                left = mid;
            }
        }
        return right;
    }


    #region ライブラリ

    public static long ToInt64(this string str) => long.Parse(str);
    public static bool IsInt32(this string str)
    {
        var o = 0;
        return int.TryParse(str, out o);
    }
    public static int ToInt32(this string str) => str == "" ? 0 : int.Parse(str);
    public static double ToDouble(this string str) => double.Parse(str);
    public static BigInteger ToBigInteger(this string str) => BigInteger.Parse(str);
    public static List<string> SplittedStringToList(this string str) => str.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).ToList();
    public static List<int> SplittedStringToInt32List(this string str) => str.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).Select(x => int.Parse(x)).ToList();
    public static List<long> SplittedStringToInt64List(this string str) => str.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).Select(x => long.Parse(x)).ToList();
    public static List<BigInteger> SplittedStringToBigInteger(this string str) => str.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).Select(x => BigInteger.Parse(x)).ToList();
    public const int INF = int.MaxValue / 4;
    public const long LONGINF = long.MaxValue / 2;
    public const int Mod1e9 = 1000000007;
    public static List<int> ToCumulativeSumList(this List<int> list)
    {
        var ls = new List<int>
        {
            list[0]
        };
        var count = list.Count;
        for (int i = 1; i < count; i++)
        {
            ls.Add(list[i] + ls.Last());
        }
        return ls;
    }

    public static void PrintArray(int[,] array)
    {
        for (int i = 0; i < array.GetLength(0); i++)
        {
            var sb = new StringBuilder();
            for (int j = 0; j < array.GetLength(1); j++)
            {
                if (array[i, j] < 0)
                {
                    sb.Append(-1).Append(" ");
                }
                else
                {
                    sb.Append(array[i, j]).Append(" ");
                }
            }
            Console.WriteLine(sb.ToString().Trim());
        }
    }
    public static int Manhattan(int x1, int x2, int y1, int y2)
    {
        return Math.Abs(x1 - x2) + Math.Abs(y1 - y2);
    }

    public static int Manhattan(KeyValuePair<int, int> keyValuePair1, KeyValuePair<int, int> keyValuePair2)
    {
        return Manhattan(keyValuePair1.Key, keyValuePair2.Key, keyValuePair1.Value, keyValuePair2.Value);
    }

    public static T DeepClone<T>(this T src)
    {
        var memoryStream = new MemoryStream();
        var binaryFormatter = new BinaryFormatter();
        binaryFormatter.Serialize(memoryStream, src);
        memoryStream.Seek(0, SeekOrigin.Begin);
        memoryStream.Dispose();

        return (T)binaryFormatter.Deserialize(memoryStream);
    }

    public static Dictionary<T, int> ToCountedDictionary<T>(this IEnumerable<T> items)
    {
        var dic = new Dictionary<T, int>();
        foreach (var item in items)
        {
            if (dic.ContainsKey(item))
                dic[item]++;
            else
                dic.Add(item, 1);
        }
        return dic;
    }
    public static Dictionary<TKey, TValue> KeyValuePairListToDictionary<TKey, TValue>(this IEnumerable<KeyValuePair<TKey, TValue>> pairs)
    {
        var dic = new Dictionary<TKey, TValue>();
        foreach (var item in pairs)
        {
            dic.Add(item.Key, item.Value);
        }
        return dic;
    }
    public class Scanner
    {
        private readonly TextReader reader;
        public Scanner()
        {
            reader = Console.In;
        }
        public Scanner(TextReader reader)
        {
            this.reader = reader;
        }
        private string NextWord()
        {
            var sb = new StringBuilder();
            while (true)
            {
                var c = reader.Read();
                if ((c == 13 || c == 10 || c == 32) && sb.Length > 0 || c == -1)
                {
                    break;
                }
                sb.Append((char)c);
            }
            return sb.ToString().Trim();
        }
        public int NextInt() => NextWord().ToInt32();
        public string Next() => NextWord();
        public double NextDouble() => NextWord().ToDouble();
        public long NextLong() => NextWord().ToInt64();
        public BigInteger NextBigInteger() => NextWord().ToBigInteger();
        public string NextLine()
        {
            var str = reader.ReadLine();
            if (string.IsNullOrWhiteSpace(str))
            {
                return reader.ReadLine();
            }
            else
            {
                return str;
            }
        }
        private List<string> NextLineToList() => NextLine().Split(new char[] { ' ' },
                                                                  StringSplitOptions.RemoveEmptyEntries)
                                                           .ToList();
        public List<int> NextLineToIntList() => NextLineToList().Select(x => int.Parse(x))
                                                                .ToList();
    }
    public static long Sums(IEnumerable<int> list)
    {
        var sum = 0L;
        foreach (var item in list)
        {
            sum += Math.Abs(item);
        }
        return sum;
    }
    public static string IEnumerableListToString<T>(this IEnumerable<T> ls, bool withSpace = false)
    {
        var sb = new StringBuilder();
        foreach (var item in ls)
        {
            sb.Append(item);
            if (withSpace)
            {
                sb.Append(" ");
            }
        }
        return sb.ToString();
    }
    #endregion

    public static int[] dx = { -1, 1, 0, 0 };
    public static int[] dy = { 0, 0, 1, -1 };

    public static int[] dxx = { 0, 1, 1, 1, 0, -1, -1, -1 };
    public static int[] dyy = { 1, 1, 0, -1, -1, -1, 0, 1 };

}