package main import . "fmt" import "time" func main() { var n int Scan(&n) d:=0*time.Minute const f="15:4" for ;n>0;n-- { var s,t string Scan(&s,&t) a,_:=time.Parse(f,s) b,_:=time.Parse(f,t) if b.Compare(a)<= 0 { b=b.AddDate(0,0,1) } d+=b.Sub(a) } Println(int64(d.Minutes())) }