import java.util.*;
import java.lang.*;
import java.io.*;
import java.text.DecimalFormat;
class Main
{
{
format.setDecimalSeparatorAlwaysShown(false);
double children ;
double cakes = 0 ;
double milk = 0;
double child ;
Scanner in
= new Scanner
(System.
in); children= in.nextDouble();
while (in.hasNextDouble()){
child= in.nextDouble();
if ( child < 30) {
cakes++;
milk += 2;
}
}
System.
out.
print(format.
format(Math.
ceil(milk
/9))); System.
out.
print(format.
format(cakes
));
}
}
aW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CmltcG9ydCBqYXZhLnRleHQuRGVjaW1hbEZvcm1hdDsKCgpjbGFzcyBNYWluCnsKCXB1YmxpYyBzdGF0aWMgdm9pZCBtYWluIChTdHJpbmdbXSBhcmdzKSB0aHJvd3MgamF2YS5sYW5nLkV4Y2VwdGlvbgoJewoJCURlY2ltYWxGb3JtYXQgZm9ybWF0ID0gbmV3IERlY2ltYWxGb3JtYXQoKTsKICAgICAgICBmb3JtYXQuc2V0RGVjaW1hbFNlcGFyYXRvckFsd2F5c1Nob3duKGZhbHNlKTsKCQlkb3VibGUgY2hpbGRyZW4gOwoJCWRvdWJsZSBjYWtlcyA9IDAgOwoJCWRvdWJsZSBtaWxrID0gMDsgCgkJZG91YmxlIGNoaWxkIDsKCQlTY2FubmVyIGluPSBuZXcgU2Nhbm5lcihTeXN0ZW0uaW4pOwoJCWNoaWxkcmVuPSBpbi5uZXh0RG91YmxlKCk7CiAgICAJd2hpbGUgKGluLmhhc05leHREb3VibGUoKSl7CiAgICAJCWNoaWxkPSBpbi5uZXh0RG91YmxlKCk7CiAgICAgICAgCWlmICggY2hpbGQgPCAzMCkgewogICAgICAgICAgICAJY2FrZXMrKzsgCiAgICAgICAgICAgIAltaWxrICs9IDI7CiAgICAgICAgCX0KCQl9CiAgICAJU3lzdGVtLm91dC5wcmludChmb3JtYXQuZm9ybWF0KE1hdGguY2VpbChtaWxrLzkpKSk7CiAgICAJU3lzdGVtLm91dC5wcmludCgiICIpOwogICAgCVN5c3RlbS5vdXQucHJpbnQoZm9ybWF0LmZvcm1hdChjYWtlcykpOwogICAgCQoJfQp9