import java.util.*;
import java.lang.*;
import java.io.*;
class Main
{
{
Scanner in
= new Scanner
(System.
in); int n = in.nextInt(); // число учеников
int pie = 0;
for (int i=0; i<n; i++)
{
int w = in.nextInt();
if (w < 30)
pie++;
}
int pack
= (int)Math.
ceil((pie
*0.2)/0.9); System.
out.
print(pack
+ " " + pie
);
}
}
aW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CgpjbGFzcyBNYWluCnsKCXB1YmxpYyBzdGF0aWMgdm9pZCBtYWluIChTdHJpbmdbXSBhcmdzKSB0aHJvd3MgamF2YS5sYW5nLkV4Y2VwdGlvbgoJewoJCSBTY2FubmVyIGluID0gbmV3IFNjYW5uZXIoU3lzdGVtLmluKTsKCQkgaW50IG4gPSBpbi5uZXh0SW50KCk7IC8vINGH0LjRgdC70L4g0YPRh9C10L3QuNC60L7QsgoJCSBpbnQgcGllID0gMDsgCiAgCQkgZm9yIChpbnQgaT0wOyBpPG47IGkrKykKICAJCSB7CiAgCQkgCWludCB3ID0gaW4ubmV4dEludCgpOwogIAkJIAlpZiAodyA8IDMwKQogIAkJIAkJcGllKys7CiAgCQkgfQogIAkJIGludCBwYWNrID0gKGludClNYXRoLmNlaWwoKHBpZSowLjIpLzAuOSk7CiAgCQkgU3lzdGVtLm91dC5wcmludChwYWNrKyAiICIgKyBwaWUpOwogIAkJIAoKCX0KfQ==