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.Arrays;
import java.util.Scanner;

public class Towers {

  public void sort(int arrA[]) {
    int size = arrA.length;

    // Build heap
    for (int i = size / 2 - 1; i >= 0; i--)
      heapify(arrA, size, i);

    // One by one extract (Max) an element from heap and
    // replace it with the last element in the array
    for (int i=size-1; i>=0; i--) {

      //arrA[0] is a root of the heap and is the max element in heap
      int x = arrA[0];
      arrA[0] = arrA[i];
      arrA[i] = x;

      // call max heapify on the reduced heap
      heapify(arrA, i, 0);
    }
  }

  // To heapify a subtree with node i
  void heapify(int arrA[], int heapSize, int i) {
    int largest = i; // Initialize largest as root
    int leftChildIdx  = 2*i + 1; // left = 2*i + 1
    int rightChildIdx  = 2*i + 2; // right = 2*i + 2

    // If left child is larger than root
    if (leftChildIdx  < heapSize && arrA[leftChildIdx ] > arrA[largest])
      largest = leftChildIdx ;

    // If right child is larger than largest so far
    if (rightChildIdx  < heapSize && arrA[rightChildIdx ] > arrA[largest])
      largest = rightChildIdx ;

    // If largest is not root
    if (largest != i) {
      int swap = arrA[i];
      arrA[i] = arrA[largest];
      arrA[largest] = swap;

      // Recursive call to  heapify the sub-tree
      heapify(arrA, heapSize, largest);
    }
  }

  public static void main(String args[]) {
    Towers heapSort = new Towers();
    Scanner scanner = new Scanner(System.in);
    int num = scanner.nextInt();
    int[] arrA = new int[num];
    for (int i = 0; i < num; i++) {
      arrA[i] = scanner.nextInt();
    }
    heapSort.sort(arrA);

    int min = arrA[0];
    int tot = arrA.length;
    int h = 1;
    int th = 1;
    for (int i = 1; i < arrA.length; i++) {
      if (min == arrA[i]) {
        h++;
        tot--;
      } else {
        h = 1;
        min = arrA[i];
      }
      if (th < h) {
        th = h;
      }
    }
    System.out.println(th + " " + tot);
  }
}