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.BufferedReader;
import java.io.InputStreamReader;
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class CF {public static void main(String[] args) throws Exception {new Solve();}}

class Solve { public Solve() throws Exception{solve();}
    void solve() throws Exception {
        int n = NI();
        Map<Integer, Integer> q = new HashMap<>();
        int maxH = 0;
        while (n-- > 0) {
            int t = NI();
            Integer w = q.get(t);
            q.put(t, w == null ? 1 : w + 1);
            maxH = max(maxH, q.get(t));
        }
        System.out.println(maxH + " " + q.size());
    }


    final int INF = Integer.MAX_VALUE;
    final long LINF = Long.MAX_VALUE;
    void inInt(int[]a,int n)throws Exception{for(int i=0;i<n;i++)a[i]=NI();}
    void inLong(long[]a,int n)throws Exception{for(int i=0;i<n;i++)a[i]=NL();}
    BufferedReader stdin=new BufferedReader(new InputStreamReader(System.in));
    StringTokenizer st=new StringTokenizer("");
    int min(int i1,int i2){return i1<i2?i1:i2;}
    long min(long i1,long i2){return i1<i2?i1:i2;}
    int max(int i1,int i2){return i1>i2?i1:i2;}
    long max(long i1,long i2){return i1>i2?i1:i2;}
    String NS()throws Exception{while(!st.hasMoreTokens())st=new StringTokenizer(stdin.readLine());return st.nextToken();}
    String NLn()throws Exception{return stdin.readLine();}
    int NI()throws Exception{return Integer.parseInt(NS());}
    long NL()throws Exception{return Long.parseLong(NS());}
    double ND()throws Exception{return Double.parseDouble(NS());}
    int abs(int x){return x<0?-x:x;}
    long abs(long x){return x<0?-x:x;}
    int mod(int x,int mod){return(x+mod)%mod;}
}
class ArrayUtils{public static void mergeSort(long[]a){long[]src=a.clone();mergeSortInt(src, a, 0, a.length);}
    public static void mergeSortInt(long[]src,long[]dest,int low,int high) {
        int length = high - low;
        if(length == 1) return;
        if (length == 2) {
            if(dest[low] > dest[high-1]){long t = dest[low];dest[low] = dest[high-1];dest[high-1] = t;}
            return;}
        int mid=(low+high)>>>1;
        mergeSortInt(dest,src,low,mid);
        mergeSortInt(dest,src,mid,high);
        for(int i=low,p=low,q=mid;i<high;i++)if(q>=high||p<mid&&src[p]<=src[q])dest[i]=src[p++];else dest[i] = src[q++];}}