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