gets;x=y=0;(c,l=3*$_.to_i/250,~/$/+~~/ /-c;x+=c;l>0?y+=l:x+=l)while gets;print x,' ',y