过不了大数据 痛苦
import java.util.*;
class Main{
public static void main(String[] args) {
Scanner in =new Scanner(System.in);
int n=in.nextInt();
int m=in.nextInt();
int t=in.nextInt();
long a[][]=new long [n+1][t+1];
for(int i=1;i<=m;i) {
int x=in.nextInt();
int y=in.nextInt();
a[y][x]+=2;
}
int ans=0;
for(int i=1;i<=n;i) {
for(int j=1;j<=t;j++) {
if(j==1) {
continue;
}
if(a[i][j]==0) {
if(a[i][j-1]>0) {
a[i][j]+=a[i][j-1]-1;
}
}else {
a[i][j]+=a[i][j-1];
}
}
if(a[i][t]>=5) {
ans++;
}
}
System.out.println(ans);
}
}