#include #define PB push_back #define MP make_pair #define REP(i,n) for (int i=0;i<(n);i++) #define FOR(i,a,b) for(int i=(a);i<(b);i++) #define ALL(a) (a).begin(),(a).end() using namespace std; typedef long long ll; typedef unsigned long long ull; typedef pair P; const int INF=1e9; int main(){ int n,h1,m1,h2,m2;char com; cin>>n; int ans=0; REP(i,n){ cin>>h1>>com>>m1>>h2>>com>>m2; int t1=h1*60+m1,t2=h2*60+m2; if(t2