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.Scanner;

public class MaxHeapTest02 {

  static class MaxHeap {
    private int[] array;
    private int size;
    private int part;

    MaxHeap(int[] array) {
      this.array = array;
      this.part = 0;
      this.size = array.length;
    }

    static MaxHeap createArray(int[] array) {
      MaxHeap heap1 = new MaxHeap(array);
      for (int i = 0; i < array.length; i++) {
        heap1.insert(i);
      }
      return heap1;
    }
    void insert(int pos) {
      array[part] = array[pos];
      bubble_up(part);
      part++;
    }
    int getParent(int pos) {
      if (pos == 0) {
        return 0;
      }
      return (pos - 1) / 2;
    }
    int leftChild(int pos) {
      return 2 * pos + 1;
    }
    int rightChild(int pos) {
      return 2 * pos + 2;
    }
    void swap(int a, int b) {
      int temp = array[a];
      array[a] = array[b];
      array[b] = temp;
    }

    void bubble_up(int pos) {
      while (pos > 0 && array[pos] < array[getParent(pos)]) {
        swap(pos, getParent(pos));
        pos = getParent(pos);
      }
    }
    int maxChild(int a, int b) {
      if (array[a] < array[b]) {
        return a;
      }
      return b;
    }
    void extract_max_recursive(int n, int index) {
      int l = leftChild(index);
      int r = rightChild(index);
      int smallest = index;

      if (l < n && array[l] < array[smallest]) {
        smallest = l;
      }

      if (r < n && array[r] < array[smallest]) {
        smallest = r;
      }

      if (smallest != index) {
        swap(smallest, index);
        extract_max_recursive(n, smallest);
      }

    }

    void extract_max_recursive() {
      while (part > 0) {
        swap(0, part - 1);
        extract_max_recursive(part - 1, 0);
        part--;
      }
    }

    public String toString() {
      String result = "The array is: \n";
      for (int i = 0; i < array.length; i++) {
        result += array[i] + " ";
      }
      return result;
    }
  }

  public static void main(String[] args) {
    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();
    }
    MaxHeap heap = MaxHeap.createArray(arrA);
    heap.extract_max_recursive();
    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);
  }
}
