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