#include #include #include #include #include #include #include #include #include using namespace std; #define REP(i,a,b) for(i=a;i> n; rep(i,n) { e = 0; scanf("%d:%d %d:%d",&H1,&M1,&h1,&m1); e = h1*60 + m1 -(H1*60 + M1); if(e < 0) e += 60*24; sum += e; } printf("%d\n",sum); return 0; }