using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using E = System.Linq.Enumerable;
 
class Program
 {
  static int[] A;
        static void Main(string[] args)
        {
          //入力を受け取る
          var N = int.Parse(Console.ReadLine());
          A = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();
          var type = 0;
          type = IsZeroRange(1,399);
          for(int i = 1;i <=7;i++){
            type += IsZeroRange(400*i,400*(i+1)-1);
          }
          var red = A.Where(num => num >= 3200).ToArray().Length;
          var maxtype = Math.Min(type+red,8);
          var mintype = type;
          if(type ==0 && red > 0){
            mintype = 1;
          }
          
          Console.WriteLine(2+" "+4);
        }
  
  static int IsZeroRange(int l,int r){
   // Console.WriteLine(l+" "+r);
    if(A.Where(num => num >= l && num <= r).ToArray().Length != 0){
      return 1;
    }else{
      return 0;
    }
  }
}
