import java.util.Scanner; public class Main70 { public static void main(String[] args) { Main70 p = new Main70(); } public Main70() { solve(); } public void solve() { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int total = 0; for(int i=0;ien) total += (24*60 - st) + en; else total += (en-st); } System.out.println(total); } }