package main import . "fmt" func main() { var n,t,x,y int Scan(&n) for ;n>0;n-- { var s string Scan(&t,&s) t=12*t/1000 t-=len(s) if t<0 { y-=t } else { x+=len(s) } } Println(x,y) }