Little Vasya has received a young builder’s kit. The kit consists of several wooden bars, the lengths of all of them are known. The bars can be put one on the top of the other if their lengths are the same.

Vasya wants to construct the minimal number of towers from the bars. Help Vasya to use the bars in the best way possible.

Input

The first line contains an integer N (1 ≤ N ≤ 1000) — the number of bars at Vasya’s disposal. The second line contains N space-separated integers li — the lengths of the bars. All the lengths are natural numbers not exceeding 1000.

Output

In one line output two numbers — the height of the largest tower and their total number. Remember that Vasya should use all the bars.

Examples

Input

3
1 2 3


Output

1 3


Input

4
6 5 6 7


Output

2 3
import java.io.*;
import java.util.*;
import java.math.*;



public class Number {

    private long num;
    Number(long num)
    {
        this.num = num;
    }

    void setNum(long num)
    {
        this.num = num;
    }

    long getNum()
    {
        return num;
    }

    static void swap(Number a, Number b)
    {
        long tmp = a.getNum();
        a.setNum(b.getNum());
        b.setNum(tmp);
    }

    static void bubbleSort(Number[] values)
    {
        if (values == null || values.length <=1)
            return;

        boolean ok = false;
        while (!ok)
        {
            ok = true;
            for (int i = 1; i < values.length; i++) {
                if (values[i-1].getNum() > values[i].getNum())
                {
                    swap(values[i-1], values[i]);
                    ok = false;
                }
            }
        }
    }

    static void quickSort(Number[] arr, int left, int right) {
        int i = left, j = right;
        long tmp;
        long pivot = arr[(left + right) / 2].getNum();

        while (i <= j) {
            while (arr[i].getNum() < pivot)
                i++;
            while (arr[j].getNum() > pivot)
                j--;
            if (i <= j) {
                tmp = arr[i].getNum();
                arr[i].setNum(arr[j].getNum());
                arr[j].setNum(tmp);
                i++;
                j--;
            }
        }

        if (left < i - 1)
            quickSort(arr, left, i - 1);
        if (i < right)
            quickSort(arr, i, right);
    }

    static void printArray(Number[] a)
    {
        for (int i = 0; i < a.length; i++) {
            System.out.print(a[i].getNum() + " ");
        }
        System.out.println();
    }

    static boolean isEquel(Number a, Number b)
    {
        return a.getNum() == b.getNum();
    }

    @Override
    public String toString() {
        return "Number " + num;
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        final int n = sc.nextInt();

        Number[] a = new Number[n];

        for (int i = 0; i < n; i++) {
            a[i] = new Number(sc.nextInt());
        }

        quickSort(a, 0, n - 1);
//        printArray(y);

        int count = 1;
        int maxHeight = 0;
        int height = 1;

        for (int i = 1; i < n; i++) {
            if (isEquel(a[i-1], a[i]))
            {
                height++;
            }
            else
            {
                if (height > maxHeight) maxHeight = height;
                height = 1;
                count++;
            }
        }

        if (height > maxHeight) maxHeight = height;

        System.out.println(maxHeight + " " + count);


    }
}
