//const fi='colorful.inp';
 //     fo='colorful.out';
var a:array[0..10000] of longint;
    kt1,kt2,kt3,kt4,kt5,kt6,kt7,kt8:boolean;
    n,d,dp:longint;
//procedure mo;
//begin
//        assign(input,fi);
 //       reset(input);
  //      assign(output,fo);
  //      rewrite(output);
//end;

procedure nhap;
var i:longint;
begin
        readln(n);
        for i:=1 to n do
        begin
                read(a[i]);
                if a[i] >= 3200 then
                        inc(dp)
        end;
end;

procedure xuly;
var i:longint;
begin
        for i:=1 to n do
        begin
                if (a[i] >= 2799)and(a[i] < 3199) then
                begin
                        if kt1=true then
                        begin
                                kt1:=false;
                                inc(d);
                        end;
                end;
                if (a[i] >= 2399)and(a[i] < 2799) then
                begin
                        if kt2=true then
                        begin
                                kt2:=false;
                                inc(d);
                        end;
                end;
                if (a[i] >= 1999)and(a[i] < 2399) then
                begin
                        if kt3=true then
                        begin
                                kt3:=false;
                                inc(d);
                        end;
                end;
                if (a[i] >= 1599)and(a[i] < 1999) then
                begin
                        if kt4=true then
                        begin
                                kt4:=false;
                                inc(d);
                        end;
                end;
                if (a[i] >= 1199)and(a[i] < 1599) then
                begin
                        if kt5=true then
                        begin
                                kt5:=false;
                                inc(d);
                        end;
                end;
                if (a[i] >= 799)and(a[i] < 1999) then
                begin
                        if kt6=true then
                        begin
                                kt6:=false;
                                inc(d);
                        end;
                end;
                if (a[i] >= 399)and(a[i] < 799) then
                begin
                        if kt7=true then
                        begin
                                kt7:=false;
                                inc(d);
                        end;
                end;
                if (a[i] >= 1)and(a[i] < 399) then
                begin
                        if kt8=true then
                        begin
                                kt8:=true;
                                inc(d);
                        end;
                end;
        end;
end;

procedure xuat;
begin
       if dp=n then
       begin
                write(1,' ',n);
       end
       else
        write(d,' ',d+dp);
end;

begin
        //mo;
        nhap;
        kt1:=true;
        kt2:=true;
        kt3:=true;
        kt4:=true;
        kt5:=true;
        kt6:=true;
        kt7:=true;
        kt8:=true;
        xuly;
        xuat;
end.
