1#include <iostream>2using namespace std;3int main()4{5 int n, p, q, f=0;6 cin >> n;7 for (int i = 1; i <= n; i++) {8 cin >> p >> q;9 if (q - p >=2) {10 f++;11 }12 }13 cout << f;14}