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.util.*;
import java.awt.Point;
import java.io.*;
import java.math.BigInteger;

public class a37 
{
    FastScanner in;
    PrintWriter out;
    
    public void solve() throws IOException
    {
        int n = in.nextInt();
        
        HashSet <Integer> my_set = new HashSet <Integer>();
        
        int mas[] = new int [1001];
        Arrays.fill(mas, 0);
        
        for (int i = 0; i < n; i++)
        {
            int tmp;
            
            tmp = in.nextInt();
            mas[tmp]++;

            my_set.add(tmp);
            
        }
        Arrays.sort(mas);
        
        out.print(mas[1000] + " " + my_set.size());
        
    }
            

    public void run() 
    {
        try 
        {
            //in  = new FastScanner(new File("sum.in"));
            //out = new PrintWriter(new File("sum.out"));
            
            in  = new FastScanner();
            out = new PrintWriter(System.out);

            solve();

            out.close();
        }
        catch (IOException e) 
        {
            e.printStackTrace();
        }
    }

    class FastScanner 
    {
        BufferedReader  br;
        StringTokenizer st;
        
        FastScanner() 
        {
            br = new BufferedReader(new InputStreamReader(System.in));        
        }

        FastScanner(File f) 
        {
            try
            {
                br = new BufferedReader(new FileReader(f));
            }
            catch (FileNotFoundException e) 
            {
                e.printStackTrace();
            }
        }

        String nextLine() 
        {
            String ret = null;
            try
        {
                ret = br.readLine();
        }
        catch (IOException e)
        {
            e.printStackTrace();
        }
            
            return ret;
        }

        String next() 
        {
            while (st == null || !st.hasMoreTokens()) 
            {
                try
                {
                    st = new StringTokenizer(br.readLine());
                } 
                catch (IOException e) 
                {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() 
        {
            return Integer.parseInt(next());
        }
        
        long nextLong() 
        {
            return Long.parseLong(next());
        }
        
        double nextDouble() 
        {
            return Double.parseDouble(next());
        }
        
        int[] nextIntArray(int size) 
        {
            int[] array = new int[size];
            
            for (int i = 0; i < size; i++)
            {
                array[i] = nextInt();
            }
            
            return array;
        }
        
        long[] nextLongArray(int size) 
        {
            long[] array = new long[size];
            
            for (int i = 0; i < size; i++)
            {
                array[i] = nextLong();
            }
            
            return array;
        }
        
        BigInteger nextBigInteger() 
        {
            return new BigInteger(next());
        }
        
        Point nextIntPoint()
        {
            int x = nextInt();
            int y = nextInt();
            return new Point(x, y);
        }
        
        Point[] nextIntPointArray(int size)
        {
            Point[] array = new Point[size];
            
            for (int index = 0; index < size; ++index)
            {
                array[index] = nextIntPoint();
            }
            
            return array;
        }
        
        List<Integer>[] readGraph(int vertexNumber, int edgeNumber, boolean undirected)
        {
            List<Integer>[] graph = new List[vertexNumber];
                    
            for (int index = 0; index < vertexNumber; ++index)
            {
                graph[index] = new ArrayList<Integer>();
            }
                    
            while (edgeNumber-- > 0)
            {
                int from = nextInt() - 1;
                int to   = nextInt() - 1;
                        
                graph[from].add(to);
                
                if(undirected)
                    graph[to].add(from);
            }
                    
            return graph;
        }
    }

    public static void main(String[] arg) 
    {
        new a37().run();
    }
}
