#!ruby -rtime gets p$<.map{|s|a,b=s.split.map{|c|Time.parse c};(b-a).div(60)%1440}.sum