using System; using System.Linq; public class P0070 { public static void Main() { var n = int.Parse(Console.ReadLine().Trim()); const int day = 1440; int result = 0; for(int i=0; i s.Split(":")).Select(int.Parse).ToList(); var start = hmhm[0] * 60 + hmhm[1]; var end = hmhm[2] * 60 + hmhm[3]; if(end < start) { result += day - start + end; } else { result += end - start; } } Console.WriteLine(result); } }