fork download
  1. # your code goes here
  2. N=int(input())
  3. c=0
  4. for i in range(N):
  5. p,q=map(int,input().split())
  6. if(q-p>=2):
  7. c+=1
  8. print(c)
  9.  
Success #stdin #stdout 0.05s 9792KB
stdin
3
1 2
2 3
3 4
stdout
0