#include #include #include #include #include #include #include #include #include #define rep(i,j,k) for(int i=j;i #define INF 1000000000 #define MOD 1000000009 #define pb push_back #define mp make_pair typedef long long ll; int dx[4]={0,1,0,-1},dy[4]={1,0,-1,0}; using namespace std; ll gcd(ll a,ll b){ if(a>n; int ans=0; rep(i,0,n){ int h,m,hh,mm; char c; cin>>h>>c>>m>>hh>>c>>mm; int t=h*60+m,tt=hh*60+mm; if(tt-t<0){ ans+=(1440-t)+tt; }else { ans+=tt-t; } } cout<