void main(){ import std.stdio, std.string, std.conv, std.algorithm; import std.typecons; int n, m; rd(n, m); auto seq=new Tuple!(int, int)[](m); foreach(i; 0..m){ int d1, t11, t12, d2, t21, t22; scanf("%d %d:%d %d %d:%d", &d1, &t11, &t12, &d2, &t21, &t22); seq[i]=Tuple!(int, int)(d1*24*60+t11*60+t12, d2*24*60+t21*60+t22); } sort!"a[1]=0) data[j]=e[1], sum++; } writeln(sum); } void rd(T...)(ref T x){ import std.stdio, std.string, std.conv; auto l=readln.split; assert(l.length==x.length); foreach(i, ref e; x){ e=l[i].to!(typeof(e)); } }