George has recently entered the BSUCP (Berland State University for Cool Programmers). George has a friend Alex who has also entered the university. Now they are moving into a dormitory. 

George and Alex want to live in the same room. The dormitory has n rooms in total. At the moment the i-th room has p_{i} people living in it and the room can accommodate q_{i} people in total (p_{i} ≤ q_{i}). Your task is to count how many rooms has free place for both George and Alex.


-----Input-----

The first line contains a single integer n (1 ≤ n ≤ 100) — the number of rooms.

The i-th of the next n lines contains two integers p_{i} and q_{i} (0 ≤ p_{i} ≤ q_{i} ≤ 100) — the number of people who already live in the i-th room and the room's capacity.


-----Output-----

Print a single integer — the number of rooms where George and Alex can move in.


-----Examples-----
Input
3
1 1
2 2
3 3

Output
0

Input
3
1 10
0 10
10 10

Output
2

Difficulty: EASY

Solutions:
import sys
n = int(sys.stdin.readline())
count = 0
for i in range(n):
	in_str = sys.stdin.readline().split()
	p = int(in_str[0])
	q = int(in_str[1])
	if p + 2 <= q:
		count += 1
print(count)


operations_list = []
nums = 0
n = int(input())
for i in range(n):
	(p, q) = map(int, input().split())
	x = [p, q]
	operations_list.append(x)
for (a, b) in operations_list:
	if b - a >= 2:
		nums = nums + 1
print(nums)


n = input()
res = 0
for i in range(int(n)):
	(p, q) = input().split(' ')
	if int(q) - int(p) >= 2:
		res += 1
print(res)


n = int(input())
permit = 0
for i in range(0, n):
	(p, q) = map(int, input().split())
	if q - p >= 2:
		permit = permit + 1
	else:
		permit = permit
print(permit)


n = int(input())
l = []
for i in range(n):
	(a, b) = map(int, input().split())
	l.append(b - a >= 2)
print(sum(l))


n = int(input())
l1 = []
for i in range(n):
	l = list(map(int, input().split()))
	l1.append(l)
c = 0
for i in range(len(l1)):
	l2 = l1[i]
	if l2[1] - l2[0] >= 2:
		c = c + 1
print(c)


import collections as c

def getInts():
	return [int(s) for s in input().split()]

def getInt():
	return int(input())

def getStrs():
	return [s for s in input().split()]

def getStr():
	return input()

def listStr():
	return list(input())

def solve():
	N = getInt()
	ans = 0
	for n in range(N):
		(P, Q) = getInts()
		if Q - P > 1:
			ans += 1
	return ans
ans = solve()
print(ans)


n = int(input())
c = 0
for i in range(n):
	(p, q) = list(map(int, input().split()))
	if q - p >= 2:
		c += 1
print(c)


c = 0
for _ in range(int(input())):
	a = list(map(int, input().split()))
	if a[1] - a[0] >= 2:
		c += 1
print(c)


n = int(input())
x = 0
while n > 0:
	n -= 1
	(a, b) = input().split()
	(a, b) = (int(a), int(b))
	x += abs(a - b) >= 2
print(x)


n = int(input())
room = 0
for i in range(n):
	(p, q) = [int(x) for x in input().split()]
	if q - p >= 2:
		room += 1
print(room)


x = int(input())
count = 0
count2 = 0
while count != x:
	(y, z) = map(int, input().split())
	if z - y >= 2:
		count2 += 1
	count += 1
print(str(count2))


n = int(input())
print(len([x for (x, y) in [[*map(int, input().split())] for _ in range(n)] if y - x >= 2]))


n = int(input())
cou = 0
for i in range(n):
	(a, b) = map(int, input().split(' '))
	if b - a >= 2:
		cou += 1
print(cou)


m = int(input())
count = 0
for k in range(m):
	x = list(map(int, input().split()))
	if x[1] - x[0] > 1:
		count = count + 1
print(count)


n = int(input())
c = 0
for i in range(n):
	z = input().split()
	p = int(z[0])
	q = int(z[1])
	if q - p >= 2:
		c = c + 1
print(c)


count = 0
for _ in range(int(input())):
	(p, q) = map(int, input().split())
	if q - p > 1:
		count += 1
print(count)


x = int(input())
w = 0
while x > 0:
	y = input().split()
	if int(y[1]) - int(y[0]) >= 2:
		w = w + 1
	x = x - 1
print(w)


n = int(input())
l = 0
for i in range(n):
	(a, b) = [int(i) for i in input().split()]
	if b - a > 1:
		l += 1
print(l)


n = int(input())
num = 0
for i in range(n):
	pq = input().split()
	if int(pq[1]) - int(pq[0]) >= 2:
		num += 1
print(num)


n = int(input())
res = 0
for i in range(n):
	(a, b) = map(int, input().split())
	if b - a > 1:
		res += 1
print(res)


n = int(input())
count = 0
for i in range(n):
	(x, y) = [int(m) for m in input().split()]
	if y - x >= 2:
		count += 1
print(count)


t = int(input())
c = 0
for i in range(t):
	(p, q) = map(int, input().split())
	if p + 2 <= q:
		c = c + 1
print(c)


n = int(input())
rooms = 0
for _ in range(n):
	inf = input().split(' ')
	if int(inf[1]) - int(inf[0]) >= 2:
		rooms += 1
print(rooms)


n = int(input())
c = 0
for i in range(n):
	m = list(map(int, input().split()))
	a = m[0]
	b = m[1]
	if abs(a - b) >= 2:
		c += 1
print(c)


n = int(input())
count = 0
for _ in range(n):
	(p, q) = map(int, input().split())
	if abs(p - q) >= 2:
		count += 1
print(count)


n = int(input())
i = 0
rooms = []
while i < n:
	rooms.append(input().split())
	i = i + 1
k = 0
i = 0
while i < n:
	room = rooms[i]
	if int(room[1]) - int(room[0]) >= 2:
		k = k + 1
	i = i + 1
print(k)


n = int(input())
room = 0
ls = []
for i in range(n):
	ls.append(list(map(int, input().split())))
for j in range(n):
	x = ls[j][1] - ls[j][0]
	if x >= 2:
		room += 1
print(room)


sum = 0
for i in range(int(input())):
	(k, p) = map(int, input().split())
	if p - k > 1:
		sum += 1
print(sum)


n = int(input())
count = 0
while n != 0:
	n -= 1
	(p, q) = map(int, input().split())
	if q - p > 1:
		count += 1
print(count)


try:
	n = int(input())
	c = 0
	for i in range(n):
		(a, b) = map(int, input().split())
		if b - a >= 2:
			c += 1
	print(c)
except:
	pass


n = int(input())
counter = 0
for i in range(n):
	listans = [int(n) for n in input().split()]
	if listans[1] - listans[0] >= 2:
		counter += 1
print(counter)


room = int(input())
counter = 0
for i in range(0, room):
	inputLine = input()
	inputList = inputLine.split(' ')
	living = int(inputList[0])
	capacity = int(inputList[1])
	if capacity - living >= 2:
		counter += 1
print(counter)


c = 0
for _ in range(int(input())):
	(p, q) = map(int, input().split())
	if q - p >= 2:
		c += 1
print(c)


n = int(input())
(s, r, count) = (0, 0, 0)
for i in range(n):
	(s, r) = map(int, input().split())
	if r - s > 1:
		count += 1
print(count)


n = int(input())
rooms = 0
while n > 0:
	n -= 1
	(number, capacity) = map(int, input().split())
	if capacity - number >= 2:
		rooms += 1
print(rooms)


n = int(input())
list = []
for i in range(n):
	list.append(input())
q = 0
for i in range(n):
	s = list[i - 1].split()
	x = int(s[0])
	y = int(s[1])
	if x + 2 <= y:
		q = q + 1
	else:
		pass
print(q)


inp = int(input())
count = 0
if inp < 0 and inp > 101:
	exit(0)
else:
	for x in range(inp):
		pq = str(input())
		newpq = pq.split()
		p = int(newpq[0])
		q = int(newpq[1])
		if q - p > 1:
			count += 1
	print(count)


a = 0
for i in range(int(input())):
	l = list(map(int, input().split()))
	(p, q) = (l[0], l[1])
	dif = q - p
	if dif >= 2:
		a += 1
	else:
		a += 0
print(a)


f = 0
for i in range(int(input())):
	(p, q) = map(int, input().split())
	if q - p > 1:
		f += 1
print(f)


a = int(input())
s = [list(map(int, input().split())) for i in range(a)]
v = 0
for i in s:
	if i[1] - i[0] >= 2:
		v += 1
print(v)


n = int(input())
l = []
for i in range(n):
	l.append(list(map(int, input().split())))
c = 0
for i in l:
	if i[1] - i[0] > 1:
		c += 1
print(c)


numRooms = int(input())
corrRooms = 0
for i in range(0, numRooms):
	roomInfo = str(input())
	infoSplit = roomInfo.split()
	tenants = int(infoSplit[0])
	capacity = int(infoSplit[1])
	if capacity - tenants >= 2:
		corrRooms += 1
print(corrRooms)


c = 0
for _ in range(int(input())):
	(x, y) = [int(x) for x in input().split()]
	if x + 2 <= y:
		c += 1
print(c)


n = int(input())
filled = [0] * n
capacity = [0] * n
rooms = 0
for i in range(n):
	(filled[i], capacity[i]) = input().split(' ')
	if int(capacity[i]) - int(filled[i]) >= 2:
		rooms += 1
print(rooms)


n = int(input())
rooms = []
availableRooms = 0
for i in range(n):
	rooms.append(list(map(int, input().split())))
for i in range(n):
	if rooms[i][1] - rooms[i][0] >= 2:
		availableRooms += 1
print(availableRooms)


rooms = int(input())
directory = []
for i in range(rooms):
	input_string = str(input()).split()
	directory.append([int(input_string[0]), int(input_string[-1])])
count = 0
for i in directory:
	if i[-1] - i[0] > 1:
		count += 1
print(count)


n = int(input())
p = 0
m = [[int(n) for n in input().split()] for i in range(n)]
for i in range(n):
	if m[i][1] - m[i][0] >= 2:
		p = p + 1
print(p)


n = int(input())
s = 0
for i in range(n):
	(p, q) = map(int, input().split())
	if p + 2 <= q:
		s += 1
print(s)


count = 0
for i in range(int(input())):
	(p, q) = list(map(int, input().split()))
	if q - p >= 2:
		count += 1
print(count)


n = int(input())
room = []
for i in range(n):
	room.append(list(map(int, input().split())))
count = 0
for i in range(n):
	cap = room[i][1] - room[i][0]
	if cap >= 2:
		count += 1
print(count)


r = int(input())
a = 0
while r != 0:
	(c, d) = map(int, input().split())
	if d - c > 1:
		a += 1
	r -= 1
print(a)


n = int(input())
r = 0
for I in range(n):
	(p, q) = map(int, input().split())
	if p + 2 <= q:
		r += 1
print(r)


n = int(input())
count = 0
for _ in range(n):
	a = list(map(int, input().split(' ')))
	if a[1] - a[0] >= 2:
		count += 1
print(count)


x = 0
n = int(input())
for i in range(n):
	room = input().split()
	(now, maxi) = (int(room[0]), int(room[1]))
	if maxi - now >= 2:
		x = x + 1
print(x)


n = int(input())
ans = 0
for i in range(n):
	l = list(map(int, input().split()))
	temp = l[1] - l[0]
	if temp > 1:
		ans = ans + 1
print(ans)


n = int(input())
ans = 0
for _ in range(n):
	(x, y) = map(int, input().split())
	if y - x >= 2:
		ans += 1
print(ans)


f = int(input())
s = 0
for i in range(f):
	(a, b) = map(int, input().split())
	s += int(b - a > 1)
print(s)


n = int(input())
k = 0
for i in range(n):
	(m, o) = [int(i) for i in input().split()]
	if o - m >= 2:
		k += 1
print(k)


from sys import stdin
from operator import sub
from functools import reduce
print(sum((reduce(sub, tuple(map(int, stdin.readline().split()))) < -1 for i in range(int(stdin.readline())))))


timmy = int(input())
jumper = 0
for i in range(timmy):
	turner = input().split()
	if int(turner[1]) - int(turner[0]) > 1:
		jumper += 1
print(jumper)


n = int(input())
c = 0
while n > 0:
	(p, q) = list(map(int, input().split()))
	if q - p >= 2:
		c += 1
	n -= 1
print(c)


n = int(input())
c = 0
for i in range(0, n):
	(x, y) = input().split()
	p = int(x)
	q = int(y)
	if q - p >= 2:
		c = c + 1
print(c)


c = 0
for i in range(int(input())):
	x = [int(x) for x in input().split()]
	if x[0] <= x[1] - 2:
		c += 1
print(c)


n = int(input())
res = 0
for _ in range(n):
	inp = input().split(' ')
	(one, two) = (int(inp[0]), int(inp[1]))
	if two - one > 1:
		res += 1
print(res)


n = int(input())
cnt = 0
for i in range(n):
	(p, q) = list(map(int, input().split()))
	cnt += 1 * (q - p >= 2)
print(cnt)


n = int(input())
s = 0
for i in range(n):
	x = [int(j) for j in input().split()]
	s = s + (x[1] - x[0] > 1)
print(s)


a = int(input())
s = 0
for i in range(a):
	(b, c) = map(int, input().split())
	if c - 2 >= b:
		s += 1
print(s)


lis = []
res = 0
nachalo = int(input())
for i in range(nachalo):
	lis.append(input().split())
for i in lis:
	if int(i[1]) - int(i[0]) > 1:
		res += 1
print(res)


t = int(input())
s = 0
while t != 0:
	a = [int(x) for x in input().split()]
	p = a[0]
	q = a[1]
	if q - p >= 2:
		s = s + 1
	t = t - 1
print(s)


n = int(input())
count = 0
for i in range(n):
	(a, b) = map(int, input().split())
	if abs(a - b) >= 2:
		count += 1
print(count)


n = int(input())
rooms = []
room_count = 0
while n > 0:
	rooms.append([int(x) for x in input().split()])
	n -= 1
for i in range(len(rooms)):
	if rooms[i][1] - rooms[i][0] >= 2:
		room_count += 1
print(room_count)


n = int(input())
count = 0
for i in range(n):
	(p, q) = map(int, input().split())
	if p - q < -1:
		count += 1
print(count)


a = int(input())
b = 0
for _ in range(a):
	(x, i) = map(int, input().split())
	if x + 2 <= i:
		b += 1
print(b)


Rooms = int(input())
count = 0
for i in range(Rooms):
	(people_living, total_capacity) = map(lambda x: int(x), input().split())
	if total_capacity - people_living >= 2:
		count += 1
print(count)


n = int(input())
result = 0
room_list = []
for i in range(n):
	temp = list(map(int, input().strip().split(' ')))
	room_list.append(temp)
for item in room_list:
	if item[0] + 1 < item[1]:
		result += 1
print(result)


a = int(input())
d = 0
for i in range(a):
	ed = input().split()
	b = int(ed[0])
	c = int(ed[1])
	if c - b >= 2:
		d += 1
print(d)


n = int(input())
answer = 0
for n in range(n):
	(p, q) = map(int, input().split())
	if q - p >= 2:
		answer += 1
print(answer)


k = int(input())
ans = 0
for _ in range(k):
	(p, q) = map(int, input().split())
	if q - p >= 2:
		ans += 1
print(ans)


n = int(input())
i = n
c = 0
while i != 0:
	(A, B) = input().split()
	(a, b) = (int(A), int(B))
	d = b - a
	if d >= 2:
		c = c + 1
	i = i - 1
print(c)


n = int(input())
x = 0
for i in range(n):
	(pi, qi) = list(map(int, input().split()))
	if qi - pi >= 2:
		x = x + 1
print(x)


a = int(input())
count = 0
for i in range(a):
	b = input().split()
	for i in range(len(b) - 1):
		if abs(int(b[i + 1]) - int(b[i])) >= 2:
			count += 1
print(count)


n = int(input())
ans = 0
for i in range(n):
	(p, q) = [int(_) for _ in input().split()]
	if q - p >= 2:
		ans += 1
print(ans)


roomsava = int(input())
room = 0
for i in range(roomsava):
	avaspace = input().split()
	ava = int(avaspace[0])
	space = int(avaspace[1])
	if ava + 2 <= space:
		room += 1
print(room)


n = int(input())
c = 0
for i in range(n):
	(a, t) = input().split(' ')
	if int(t) - int(a) >= 2:
		c = c + 1
print(c)


no = int(input())
count = 0
for i in range(no):
	(p, q) = input().split(' ')
	if int(q) - int(p) >= 2:
		count += 1
print(count)


rooms = int(input())
count = 0
for i in range(rooms):
	(p, q) = map(int, input().split())
	if abs(p - q) <= 1:
		count += 0
	elif p == q:
		count += 0
	else:
		count += 1
print(count)


t = int(input())
add = 0
for i in range(t):
	(n, m) = map(int, input().split())
	if m - n >= 2:
		add += 1
print(add)


n = int(input())
cnt = 0
while n:
	(x, y) = map(int, input().split())
	if y - x >= 2:
		cnt += 1
	n -= 1
print(cnt)


count = 0
n = int(input())
for i in range(0, n):
	b = input().split(' ')
	if int(b[1]) - int(b[0]) > 1:
		count = count + 1
print(count)


n = int(input())
cnt = 0
for i in range(n):
	(p, q) = [int(j) for j in input().split()]
	if q - p >= 2:
		cnt += 1
print(cnt)


a = int(input())
ans = 0
for i in range(a):
	(n, m) = map(int, input().split())
	if m - n >= 2:
		ans += 1
print(ans)


n = int(input())
count = 0
for i in range(n):
	(p, q) = list(map(int, input().split(' ')))
	count += int(q - p >= 2)
print(count)


total_rooms = int(input())
rooms_avail = 0
for i in range(total_rooms):
	(living, capacity) = list(map(int, input().split(' ')))
	if capacity - living >= 2:
		rooms_avail += 1
print(rooms_avail)


rooms = int(input())
c = 0
for i in range(rooms):
	pq = input().split(' ')
	p = int(pq[0])
	q = int(pq[1])
	if max(p, q) - min(p, q) >= 2:
		c += 1
print(c)


num_rooms = int(input())
available_rooms = 0
for n in range(num_rooms):
	(pi, qi) = [int(x) for x in input().split(' ')]
	if qi - pi > 1:
		available_rooms += 1
print(available_rooms)


def solution(l):
	if l[1] - l[0] >= 2:
		return 1
	return 0
n = int(input())
count = 0
for i in range(n):
	s = input()
	l = list(map(int, s.split()))
	count += solution(l)
print(count)


n = int(input())
rooms = []
for _ in range(n):
	rooms.append(list(map(int, input().split(' '))))
c = 0
for r in rooms:
	if r[1] - r[0] >= 2:
		c += 1
print(c)


spravnych = 0
for i in range(int(input())):
	(uz, celkom) = map(int, input().split())
	if celkom - uz >= 2:
		spravnych += 1
print(spravnych)


n = int(input())
res = 0
for i in range(n):
	(existing, capacity) = map(int, input().split())
	if capacity - existing >= 2:
		res += 1
print(res)


nStr = input()
n = int(nStr)
ans = 0
for i in range(n):
	PandQ = input()
	pqLS = PandQ.split()
	p = int(pqLS[0])
	q = int(pqLS[1])
	if q - p >= 2:
		ans = ans + 1
print(ans)


i = int(input())
k = []
c = 0
for j in range(0, i):
	k.append(input().split())
	if int(k[j][1]) - int(k[j][0]) > 1:
		c = c + 1
print(c)


n = int(input())
s = 0
for i in range(n):
	(v, c) = map(int, input().split())
	if v + 1 < c:
		s += 1
print(s)


k = int(input())
answer = 0
for i in range(k):
	(u, a) = list(map(int, input().split()))
	if u + 2 <= a:
		answer += 1
print(answer)


counter = 0
kol = int(input())
for i in range(kol):
	(p, q) = [int(f) for f in input().split()]
	if q - p >= 2:
		counter += 1
print(counter)


c = 0
inp = int(input())
while inp > 0:
	(p, q) = map(int, input().split())
	if q - p >= 2:
		c += 1
	inp = inp - 1
print(c)


n = int(input())
a = []
b = []
ans = 0
for i in range(n):
	(x, y) = map(int, input().split())
	a.append(x)
	b.append(y)
for i in range(n):
	if b[i] - a[i] >= 2:
		ans += 1
print(ans)


n = int(input())
c = 0
while n:
	(a, b) = map(int, input().split())
	if b - a >= 2:
		c += 1
	n -= 1
print(c)


n = int(input())
a = []
for i in range(n):
	a.append([int(x) for x in input().split()])
print(sum([1 for i in range(n) if a[i][0] + 1 < a[i][1]]))


number = int(input())
s = 0
for i in range(number):
	(a, b) = input().split()
	(a, b) = (int(a), int(b))
	if b - a >= 2:
		s = s + 1
print(s)


a = int(input())
q = 0
w = 0
for i in range(a):
	(x, y) = map(int, input().split())
	if y - x >= 2:
		w = w + 1
print(w)


a = int(input())
cnt = 0
for i in range(a):
	(b, c) = input().split()
	if int(c) - int(b) >= 2:
		cnt += 1
print(cnt)


rooms = int(input())
available = 0
for i in range(rooms):
	(living, capacity) = [int(x) for x in input().split()]
	if capacity - 2 >= living:
		available += 1
print(available)


n = int(input())
lis = []
num = 0
for i in range(n):
	tmp = input().split()
	lis.append(tmp)
for j in range(n):
	if int(lis[j][1]) >= int(lis[j][0]) + 2:
		num += 1
print(num)


a = 0
for i in range(int(input())):
	(x, y) = map(int, input().split())
	if abs(x - y) >= 2:
		a += 1
print(a)


def Accomodation(x, s):
	count = 0
	for i in range(x):
		if s[i][1] - s[i][0] >= 2:
			count = count + 1
	return count
s = []
x = int(input())
for i in range(x):
	s1 = [int(n) for n in input().split()]
	s.append(s1)
print(Accomodation(x, s))


n = int(input())
num = 0
for i in range(n):
	s = input().split()
	if int(s[1]) - int(s[0]) > 1:
		num = num + 1
print(num)


import sys
n = int(sys.stdin.readline().strip())
r = 0
for i in range(n):
	(p, q) = (int(x) for x in sys.stdin.readline().strip().split(' '))
	if q - p >= 2:
		r += 1
print(r)


size = int(input())
roomCapacity = []
for i in range(size):
	roomStr = input()
	roomStr = roomStr.split(' ')
	human = int(roomStr[0])
	capacity = int(roomStr[1])
	room = (human, capacity)
	roomCapacity.append(room)
count = 0
for i in roomCapacity:
	(human, capacity) = i
	if capacity - human >= 2:
		count += 1
print(count)


n = int(input())
c = 0
while n > 0:
	n = n - 1
	l = [int(i) for i in input().split()]
	a = l[0]
	b = l[1]
	if a + 2 <= b:
		c = c + 1
print(c)


a = int(input())
b = 0
while a:
	c = list(map(int, input().split()))
	if c[1] - 1 > c[0]:
		b += 1
	a -= 1
print(b)


ctr = 0
for _ in range(int(input())):
	(p, q) = list(map(int, input().split()))
	ctr = ctr + 1 if q - p >= 2 else ctr
print(ctr)


n = int(input())
sum = 0
for i in range(n):
	room = input().split()
	room[0] = int(room[0])
	room[1] = int(room[1])
	if room[1] - room[0] >= 2:
		sum += 1
print(sum)


n = int(input())
res = 0
for i in range(n):
	(a, b) = [int(el) for el in input().split(' ')]
	res += b - a >= 2
print(res)


import sys
n = int(sys.stdin.readline().rstrip())
ss = 0
for _ in range(n):
	(p, q) = [int(x) for x in sys.stdin.readline().split(' ')]
	if p + 2 <= q:
		ss += 1
print(ss)


n = int(input())
c = 0
for _ in range(n):
	(a, b) = list((int(x) for x in input().split()))
	if a + 1 < b:
		c += 1
print(c)


n = int(input())
cnt = 0
for i in range(n):
	(a, b) = tuple(map(int, input().strip().split()))
	if a + 2 <= b:
		cnt += 1
print(cnt)


n = int(input())
s = 0
for i in range(n):
	a = [int(x) for x in input().split()]
	if a[0] + 2 <= a[1]:
		s += 1
print(s)


x = int(input())
c = 0
for i in range(x):
	x2 = list(map(int, input().split()))
	if x2[0] + 2 <= x2[1]:
		c += 1
print(c)


def main():
	n = int(input())
	count = 0
	while n != 0:
		(a, b) = input().strip().split(' ')
		(a, b) = (int(a), int(b))
		if b - a >= 2:
			count = count + 1
		n = n - 1
	print(count)
main()


n = int(input())
no_of_rooms = 0
while n:
	(p, q) = map(int, input().split())
	if q - p >= 2:
		no_of_rooms += 1
	n -= 1
print(no_of_rooms)


x = int(input())
k = 0
i = 0
while i < x:
	(n, c) = map(int, input().split())
	if c - n >= 2:
		k += 1
	i += 1
print(k)


a = int(input())
i = 0
for _ in range(a):
	if abs(eval('-'.join(input().split()))) >= 2:
		i += 1
print(i)


n = int(input())
rooms = 0
for i in range(n):
	s = [int(x) for x in input().split()]
	p = s[0]
	q = s[1]
	d = q - p
	if d >= 2:
		rooms += 1
print(rooms)


n = int(input().strip())
s = 0
for _ in range(n):
	(p, q) = map(int, input().split(' '))
	if q - p >= 2:
		s += 1
print(s)


n = int(input())
num = 0
for i in range(n):
	(pi, qi) = [int(x) for x in input().split()]
	if qi - pi >= 2:
		num += 1
print(num)


n = int(input())

def freeRoom(n):
	room = 0
	for i in range(n):
		(p, q) = map(int, input().split())
		free_place = q - p
		if free_place >= 2:
			room += 1
	return room
rooms = freeRoom(n)
print(rooms)


n = int(input())
count = 0
for i in range(n):
	line = [int(x) for x in input().split()]
	if line[1] - line[0] > 1:
		count += 1
print(count)


n = int(input())
lroom = []
while n > 0:
	lroom.append(list(map(int, input().split(' '))))
	n -= 1
for room in lroom:
	if room[1] - room[0] >= 2:
		n += 1
print(n)


no_of_times = int(input())
answer = 0
for n in range(no_of_times):
	first_input = input()
	compared_input = first_input.split(' ')
	comapre = int(compared_input[1]) - int(compared_input[0])
	if comapre >= 2:
		answer = answer + 1
print(answer)


n = int(input())
a = 0
for i in range(n):
	(p, q) = map(int, input().split())
	a += q - p >= 2
print(a)


n = int(input())
a = 0
for i in range(n):
	l = list(map(int, input().split()))
	if l[1] - l[0] >= 2:
		a = a + 1
print(a)


from sys import stdin, stdout
inp = [x for x in stdin.read().split()]
numberOfRooms = int(inp.pop(0).lower())
count = 0
while numberOfRooms != 0:
	peopleInRoom = int(inp.pop(0).lower())
	roomCapacity = int(inp.pop(0).lower())
	numberOfRooms -= 1
	if roomCapacity - peopleInRoom >= 2:
		count += 1
print(count)


num = int(input())
room = 0
hi = 0
for i in range(num):
	lst = [int(x) for x in input().split()]
	room = lst[1] - lst[0]
	if room >= 2:
		hi += 1
print(int(hi))


n = int(input())
c = 0
for t in range(n):
	(x, y) = map(int, input().split())
	if y - x >= 2:
		c = c + 1
print(c)


n = int(input())
a = [0] * n
for i in range(n):
	(x, y) = [int(i) for i in input().split()]
	a[i] = y - x
print(len(list(filter(lambda p: p > 1, a))))


n = int(input())
I = []
for i in range(n):
	k = [int(i) for i in input().split()]
	I.append(k)
count = 0
for m in I:
	if m[1] - m[0] >= 2:
		count += 1
print(count)


dorm = int(input())
count = 0
for i in range(dorm):
	tmp = input()
	tmp_list = tmp.split(' ')
	p = int(tmp_list[0])
	q = int(tmp_list[1])
	if q - p >= 2:
		count += 1
print(count)


n = int(input())
num = 0
for i in range(n):
	(a, b) = [int(x) for x in input().split()]
	if b - a >= 2:
		num = num + 1
print(num)


n = int(input())
ans = 0
for i in range(n):
	(c, d) = map(int, input().split())
	if d - c >= 2:
		ans += 1
print(ans)


n = int(input())
count = 0
for i in range(n):
	nums = [int(j) for j in input().split()]
	if nums[1] - nums[0] >= 2:
		count += 1
print(count)


x = 0
n = int(input())
for i in range(n):
	(y, z) = list(map(int, input().split()))
	if y + 1 < z:
		x += 1
print(x)


n = int(input())
res = 0
for i in range(n):
	(p, q) = map(lambda x: int(x), input().split(' '))
	if q - p >= 2:
		res += 1
print(res)


n = int(input())
c = 0
for i in range(n):
	(a, b) = map(int, input().split())
	if a < b and b - a >= 2:
		c += 1
print(c)


def main():
	inp = int(input())
	c = 0
	for i in range(inp):
		inp2 = input().split()
		c += 1 if int(inp2[1]) >= int(inp2[0]) + 2 else 0
	print(c)
main()


def dormitory(values):
	count = 0
	for i in range(len(values)):
		if values[i][1] - values[i][0] >= 2:
			count = count + 1
	return count
n = int(input())
values = []
for i in range(n):
	value = list(map(int, input().split()))
	values.append(value)
print(dormitory(values))


counter = 0
for i in range(int(input())):
	(x, y) = map(int, input().split())
	if y - x >= 2:
		counter += 1
print(counter)


from sys import stdin, stdout, stderr, setrecursionlimit
setrecursionlimit(100000)

def debug(*e):
	if not __debug__:
		print(*e, file=stderr)

def dd(*vals):
	import inspect, re
	frame = inspect.getframeinfo(inspect.stack()[1][0])
	vs = re.search('dd\\((.+)\\)', frame.code_context[0]).group(1).split(',')
	if vs:
		debug(','.join(('{0} = {1}'.format(vs[i], v) for (i, v) in enumerate(vals))))

def trace(f):

	def traced(*args, **kw):
		debug('calling {} with args {}, {}'.format(f.__name__, args, kw))
		return f(*args, **kw)
	return traced

def read():
	return stdin.readline().rstrip()

def readarr(sep=None, maxsplit=-1):
	return read().split(sep, maxsplit)

def readint():
	return int(read())

def readia(sep=None, maxsplit=-1):
	return [int(a) for a in readarr(sep, maxsplit)]

def write(*args, **kwargs):
	sep = kwargs.get('sep', ' ')
	end = kwargs.get('end', '\n')
	stdout.write(sep.join((str(a) for a in args)) + end)

def writea(arr, sep=' ', end='\n'):
	stdout.write(sep.join((str(a) for a in arr)) + end)
n = readint()
a = []
for _ in range(n):
	(p, q) = readia()
	a.append((p, q))
write(sum((1 for (p, q) in a if q - p > 1)))


t = int(input())
c = 0
for i in range(t):
	a = list(map(int, input().split()))
	if a[1] - a[0] >= 2:
		c += 1
print(c)


def main():
	num_room = int(input())
	sum = 0
	for _ in range(num_room):
		num_list = list(input().split())
		peo = int(num_list[0])
		room = int(num_list[1])
		rest = room - peo
		if rest >= 2:
			sum += 1
		else:
			pass
	print(sum)
main()


def read():
	(p, q) = map(int, input().split())
	return (p, q)

def room_spec(n):
	nr = 0
	for i in range(n):
		(p, q) = read()
		if q - p >= 2:
			nr += 1
	return nr
n = int(input())
print(room_spec(n))


n = int(input())
l = 0
for s in range(n):
	room = input().split()
	if int(room[0]) + 1 < int(room[-1]):
		l = l + 1
	else:
		pass
print(l)


n = int(input())
k = None
count = 0
for i in range(n):
	k = input().split()
	if int(k[1]) - int(k[0]) >= 2:
		count += 1
print(count)


n = int(input())
k = 0
for i in range(n):
	st = input().split()
	if int(st[0]) + 2 <= int(st[1]):
		k += 1
print(k)


t = int(input())
c = 0
for i in range(t):
	(n, m) = [int(x) for x in input().split()]
	if m - n >= 2:
		c += 1
print(c)


a = int(input())
c = 0
for i in range(a):
	b = list(map(int, input().split()))
	if b[1] - b[0] > 1:
		c += 1
print(c)


n = int(input())
s = 0
for i in range(n):
	num1 = list(map(int, input().split()))
	if num1[1] - num1[0] >= 2:
		s += 1
	else:
		continue
print(s)


n = int(input())
c = 0
for tt in range(n):
	(a, b) = map(int, input().split())
	if b - a >= 2:
		c += 1
print(c)


def main():
	s = int(input())
	m = 0
	for i in range(s):
		(cur, max) = [int(v) for v in input().split()]
		if max - cur >= 2:
			m += 1
	print(m)
main()


n = int(input().rstrip())
cnt = 0
for i in range(n):
	(pi, qi) = map(int, input().rstrip().split())
	cnt += 1 if qi - pi >= 2 else 0
print(cnt)


n = int(input())
podxod = 0
for i in range(n):
	d = input()
	d = d.split()
	minn = int(d[0])
	maxx = int(d[1])
	if minn + 2 <= maxx:
		podxod = podxod + 1
print(podxod)


t = int(input())
k = 0
for kkk in range(t):
	(p, q) = map(int, input().split())
	if q - p >= 2:
		k += 1
print(k)


s = int(input())
cnt = 0
for i in range(s):
	(x, y) = map(int, input().split())
	if y - x >= 2:
		cnt += 1
print(cnt)


n = int(input())
li = []
count = 0
for i in range(n):
	l = list(map(int, input().split()))
	li.append(l)
for i in range(n):
	if li[i][1] - li[i][0] >= 2:
		count += 1
print(count)


n = int(input())
count = 0
for i in range(n):
	(pre, cap) = map(int, input().split())
	if cap - pre > 1:
		count += 1
print(count)


n = int(input())
rooms = []
for i in range(n):
	rooms.extend([int(x) for x in input().split()])
counter = 0
for j in range(1, len(rooms), 2):
	if rooms[j] - rooms[j - 1] >= 2:
		counter += 1
print(counter)


total = int(input())
move = 0
for x in range(0, total):
	room = list(map(int, input().split()))
	if room[1] - room[0] >= 2:
		move = move + 1
print(move)


t = int(input())
ans = 0
for i in range(t):
	(a, b) = map(int, input().split())
	b = b - a
	if 1 < b:
		ans += 1
print(ans)


def main():
	n = int(input())
	rooms = list()
	result = 0
	for x in range(n):
		s = input()
		rooms.append(s)
	for r in rooms:
		rr = r.split()
		if int(rr[0]) + 2 <= int(rr[1]):
			result += 1
	print(result)
main()


ch = 0
for i in range(0, int(input())):
	(p, q) = map(int, input().split())
	if p + 2 <= q:
		ch += 1
print(ch)


n = int(input())
tot = 0
for _ in range(n):
	(p, q) = map(int, input().split())
	if q - p >= 2:
		tot += 1
print(tot)


n = int(input())
cnt = 0
for _ in range(n):
	(p, q) = map(int, input().split())
	if q - p > 1:
		cnt += 1
print(cnt)


rooms = 0
for _ in range(int(input())):
	k = list(map(int, input().split()))
	if k[1] - k[0] >= 2:
		rooms += 1
print(rooms)


a = int(input())
k = 0
for i in range(a):
	(p, q) = map(int, input().split())
	if q - p > 1:
		k += 1
print(k)


n = int(input())
m = 0
for i in range(0, n):
	(a, b) = [int(i) for i in input().split()]
	if a <= b - 2:
		m += 1
print(m)


total = input()
contador = 0
for i in range(0, int(total)):
	(cantidad, quienes) = [int(x) for x in input().split(' ')]
	if int(cantidad) <= int(quienes) - 2:
		contador += 1
print(contador)


n = int(input())
print(len([1 for i in [input().split() for _ in range(n)] if int(i[1]) - int(i[0]) >= 2]))


import sys
n = int(input())
nb = 0
for i in range(n):
	(p, q) = map(int, sys.stdin.readline().split())
	if q - p > 1:
		nb += 1
print(nb)


n = int(input())
q = 0
for i in range(n):
	(n, t) = [int(x) for x in input().split()]
	if abs(t - n) >= 2:
		q += 1
print(q)


k = int(input())
res = 0
for i in range(k):
	r = input().split(' ')
	if int(r[1]) - int(r[0]) >= 2:
		res += 1
print(res)


n = int(input())
lst = list()
k = 0
while k < n:
	data = input()
	for j in data.split():
		lst.append(int(j))
	k = k + 1
count = 0
l = len(lst)
i = 0
while i < l - 1:
	if lst[i + 1] - lst[i] >= 2:
		count = count + 1
	i = i + 2
print(count)


def possible_accomodation(rooms):
	possible = 0
	for room in rooms:
		if room[1] - room[0] >= 2:
			possible += 1
	return possible
rooms = []
for _ in range(int(input())):
	rooms.append(list(map(int, input().split())))
print(possible_accomodation(rooms))


count = 0
for _ in range(int(input())):
	(b, a) = map(int, input().split())
	if a - b >= 2:
		count += 1
print(count)


n = int(input())
canMoveIn = 0
for _ in range(n):
	(p, q) = list(map(int, input().split()))
	if q - 2 >= p:
		canMoveIn += 1
print(canMoveIn)


n = int(input())
li = []
c = 0
for j in range(n):
	li = [int(i) for i in input().split()]
	if li[1] - li[0] >= 2:
		c = c + 1
print(c)


k = int(input())
if k > 0 and k <= 100:
	i = 0
	list1 = []
	count = 0
	while i < k:
		numbers = list(map(int, input().split()))
		i = i + 1
		list1.append(numbers)
		if numbers[1] - numbers[0] >= 2:
			count = count + 1
	print(count)


def dorm(l):
	l2 = []
	for i in range(0, len(l)):
		l2.append(l[i][1] - l[i][0])
	c1 = l2.count(1)
	c0 = l2.count(0)
	return len(l) - c0 - c1
n = int(input())
l = []
for i in range(0, n):
	l1 = list(map(int, input().split()))
	l.append(l1)
	l1 = []
print(dorm(l))


n = eval(input())
m = 0
for i in range(n):
	(p, q) = map(eval, input().split())
	if q - p >= 2:
		m = m + 1
print(m)


n = int(input())
c = 0
for i in range(n):
	(h, v) = [int(X) for X in input().split()]
	if v - h >= 2:
		c = c + 1
print(c)


size = int(input())
rooms = sum([1 if q - p >= 2 else 0 for (p, q) in [map(int, input().split()) for _ in range(size)]])
print(rooms)


rooms = int(input())
pq = []
count = 0
for i in range(rooms):
	x = input()
	x = [int(x) for x in x.split()]
	pq.append(x)
for (p, q) in pq:
	if p + 2 == q or p + 2 < q:
		count += 1
print(count)


n = int(input())
a = []
for i in range(n):
	b = list(map(int, input().split()))
	a.append(b)
s = 0
for j in range(n):
	(p, q) = (a[j][0], a[j][1])
	if q - p >= 2:
		s = s + 1
print(s)


n = int(input())
count = 0
for i in range(n):
	s = input().split()
	if int(s[0]) + 2 <= int(s[1]):
		count += 1
print(count)


val = int(input())
countRoom = 0
for i in range(1, val + 1, +1):
	(a, b) = input().split(' ')
	if int(a) + 1 < int(b):
		countRoom = countRoom + 1
print(countRoom)


c = 0
n = int(input())
for i in range(n):
	(a, b) = map(int, input().split())
	k = b - a
	if k > 1:
		c = c + 1
print(c)


SUM = 0
for _ in range(int(input())):
	TMP = list(map(int, input().split()))
	if TMP[1] - TMP[0] >= 2:
		SUM += 1
print(SUM)


a = int(input())
b = 0
while a:
	(x, y) = map(int, input().split())
	if y - x >= 2:
		b += 1
	else:
		b += 0
	a -= 1
print(b)


masukan1 = int(input())
masukan2l = []
n = 0
for i in range(0, masukan1):
	masukan2 = input()
	for j in masukan2.split():
		masukan2l = masukan2l + [int(j)]
for i in range(1, len(masukan2l), 2):
	if masukan2l[i] - masukan2l[i - 1] >= 2:
		n = n + 1
print(n)


n = int(input())
A = []
count = 0
for i in range(n):
	A.append(list(map(int, input().split())))
for j in range(n):
	if A[j][1] - A[j][0] >= 2:
		count += 1
print(count)


n = int(input(''))
l = [[int(i) for i in input().split()] for j in range(n)]
b = 0
for i in l:
	if i[1] - i[0] >= 2:
		b += 1
print(b)


rooms = input()
rooms = int(rooms)
list_avail = []
list_people = []
available = 0
for i in range(0, rooms):
	(room1, room2) = input().split()
	room1 = int(room1)
	room2 = int(room2)
	list_avail.append(room1)
	list_people.append(room2)
for i in range(len(list_avail)):
	if list_avail[i] + 1 < list_people[i]:
		available += 1
print(available)


n = int(input())
total = 0
for i in range(n):
	line = input().split()
	num = int(line[0])
	cap = int(line[1])
	deta = cap - num
	if deta >= 2:
		total = total + 1
print(total)


n = int(input())
l = 0
for i in range(n):
	(n, m) = map(int, input().split())
	if m - n > 1:
		l = l + 1
print(l)


n = int(input())
num = 0
i = 1
while i <= n:
	i += 1
	si = input().split()
	if int(si[1]) - int(si[0]) >= 2:
		num += 1
print(num)


x = int(input())
count = 0
i = 0
while i < x:
	(m, n) = map(int, input().split())
	if abs(m - n) >= 2:
		count += 1
	i += 1
print(count)


n = int(input())
cnt = 0
while n > 0:
	n -= 1
	(p, q) = [int(x) for x in input().split()]
	if q - p >= 2:
		cnt += 1
print(cnt)


try:
	n = int(input())
	count = 0
	for i in range(n):
		(p, q) = map(int, input().split())
		if q - p >= 2:
			count += 1
	print(count)
except:
	pass


c = 0
n = int(input())
for i in range(n):
	l = input().split()
	if int(l[0]) + 2 <= int(l[1]):
		c += 1
print(c)


n = int(input())
a = []
e = 0
for i in range(n):
	b = input()
	a.append(b)
for i in range(n):
	c = a[i]
	for j in range(len(c)):
		if c[j] == ' ':
			d = j
	f = int(c[:d])
	g = int(c[d + 1:])
	if g - f >= 2:
		e += 1
print(e)


n = int(input())
i = 0
j = 0
while i < n:
	room = str(input())
	room = room.split(' ')
	if int(room[1]) - int(room[0]) >= 2:
		j = j + 1
		i = i + 1
	else:
		i = i + 1
print(str(j))


a = int(input())
l = []
for i in range(a):
	(x, y) = map(int, input().split())
	l.append([x, y])
a = []
count = 0
for i in l:
	if isinstance(i, list):
		for j in range(len(i) - 1):
			a.append(i[j + 1] - i[j])
for i in a:
	if i >= 2:
		count += 1
print(count)


n = int(input())
total = 0
for i in range(0, n):
	(k, w) = (int(x) for x in input().split())
	if w - k >= 2:
		total += 1
print(total)


n = int(input())
answ = 0
while n != 0:
	a = input().split()
	if int(a[0]) + 2 <= int(a[1]):
		answ += 1
	n -= 1
print(answ)


n = int(input())
ctr = 0
for _ in range(n):
	(a, b) = map(int, input().split())
	if b - a >= 2:
		ctr += 1
print(ctr)


cnt = 0
for i in range(int(input())):
	(k, n) = map(int, input().split())
	if n - k >= 2:
		cnt += 1
print(cnt)


n = int(input())
i = 0
count = 0
while i < n:
	pq = input().split()
	pq[0] = int(pq[0])
	pq[1] = int(pq[1])
	if pq[1] - pq[0] >= 2:
		count = count + 1
	i = i + 1
print(count)


r = 0
for i in range(int(input())):
	(a, b) = map(int, input().split())
	if b - a >= 2:
		r += 1
print(r)


N = int(input())
cnt = 0
for i in range(0, N):
	(p, q) = map(int, input().split())
	if q - p >= 2:
		cnt += 1
print(cnt)


rooms = int(input())
tot = 0
for i in range(rooms):
	num = input().split()
	if int(num[1]) - int(num[0]) >= 2:
		tot += 1
print(tot)


num_rooms = 0
for i in range(int(input())):
	(p, q) = list(map(int, str(input()).split(' ')))
	num_rooms += q - p >= 2
print(num_rooms)


numberroom = int(input())
array = []
move = 0
for i in range(numberroom):
	string = input()
	temp = string.split(' ')
	array.append(temp)
	if int(array[i][1]) - int(array[i][0]) >= 2:
		move += 1
print(move)


rooms = int(input())
freeRooms = 0
while rooms > 0:
	(roomMates, roomSize) = [int(i) for i in input().split(' ')]
	if roomSize - roomMates >= 2:
		freeRooms += 1
	rooms -= 1
print(freeRooms)


n = int(input())
count = 0
for i in range(n):
	(p, q) = [int(x) for x in input().split()]
	b = q - p
	if b >= 2:
		count += 1
print(count)


n = int(input())
i = 0
s = 0
while i < n:
	(x, y) = map(int, input().split())
	if y - x >= 2:
		a = 1
		s = s + a
		i += 1
	else:
		a = 0
		s = s + a
		i += 1
print(s)


n = int(input())
r = []
c = 0
for i in range(n):
	r.append(input().split(' '))
for i in range(n):
	if int(r[i][1]) - int(r[i][0]) >= 2:
		c = c + 1
print(c)


rooms = int(input())
for i in range(rooms):
	room = [int(x) for x in input().split()]
	if room[1] - room[0] < 2:
		rooms -= 1
print(rooms)


N = int(input())
res = 0
for _ in range(N):
	(m, n) = (int(x) for x in input().split())
	if n - m >= 2:
		res += 1
print(res)


anzahl = input()
chance = 0
for i in range(0, int(anzahl)):
	zimmer = input().split()
	if int(zimmer[1]) - int(zimmer[0]) > 1:
		chance += 1
	else:
		pass
print(chance)


n = int(input())
w = 0
for k in range(n):
	a = [int(j) for j in input().split()]
	if a[1] - a[0] > 1:
		w += 1
	else:
		pass
print(w)


a = input()
y = int(a)
ans = 0
pr = []
while y > 0:
	pr.append(input())
	y = y - 1
for i in range(len(pr)):
	if int(pr[i].split(' ')[1]) - int(pr[i].split(' ')[0]) > 1:
		ans = ans + 1
print(ans)


num = int(input())
count = 0
room = 0
while count < num:
	n = input()
	(a, b) = n.split(' ')
	if int(b) - int(a) >= 2:
		room += 1
	else:
		pass
	count += 1
print(room)


n = int(input())
t = 0
for i in range(n):
	(a, b) = input().split()
	a = int(a)
	b = int(b)
	s = b - a
	if s == 0:
		t = t + 0
	elif s >= 2:
		t = t + 1
print(t)


n = int(input())
ans = 0
i = 0
while i < n:
	(p, q) = list(map(int, input().split()))
	if q - p >= 2:
		ans += 1
	i += 1
print(ans)


n = int(input())
pq = [list(map(int, input().split())) for _ in range(n)]
ans = 0
for pqi in pq:
	if pqi[1] - pqi[0] >= 2:
		ans += 1
print(ans)


room_count = int(input())
can = 0
for i in range(room_count):
	(a, b) = map(int, input().split())
	if b - a >= 2:
		can += 1
print(can)


total = int(input())
i = 0
vacancy = []
while i < total:
	box = list(map(int, input().split()))
	vacancy.append(box[1] - box[0])
	i = i + 1
j = 0
number = 0
while j < total:
	if vacancy[j] >= 2:
		number += 1
	j = j + 1
print(number)


a = input()
k = [input().split() for i in range(int(a))]
count = 0
for i in k:
	st = int(i[1]) - int(i[0])
	if st > 1:
		count += 1
print(count)


import sys
import math
s = int(input())
ans = 0
for i in range(s):
	(p, q) = [int(x) for x in input().split()]
	if q - p >= 2:
		ans += 1
print(ans)


n = int(input())
a = 0
for i in range(n):
	e = input().split(' ')
	p = int(e[0])
	q = int(e[-1])
	c = q - p
	if c >= 2:
		a += 1
print(a)


s = int(input())
count = 0
for i in range(0, s):
	m = input().split()
	p = int(m[0])
	q = int(m[1])
	if q - p >= 2:
		count = count + 1
	else:
		continue
print(count)


import math
import collections
import bisect
import heapq
import time
import random
import itertools
import sys
N = int(input())
P = [0] * N
Q = [0] * N
for i in range(N):
	(p, q) = map(int, input().split())
	P[i] = p
	Q[i] = q
ans = 0
for i in range(N):
	if Q[i] - P[i] >= 2:
		ans += 1
print(ans)


n = int(input())
Good = 0
for i in range(0, n):
	a = input().split()
	p = int(a[0])
	q = int(a[1])
	if q - p >= 2:
		Good += 1
print(Good)


n = int(input())
answ = 0
for i in range(n):
	(p, q) = map(int, input().split())
	m = q - p
	if m >= 2:
		answ += 1
print(answ)


rooms = int(input())
count = 0
for i in range(1, rooms + 1, 1):
	(a, b) = map(int, input().split())
	if a == b:
		continue
	else:
		diff = b - a
		if diff >= 2:
			count += 1
print(count)


x = int(input())
current = []
available = []
y = 0
for i in range(x):
	a = input()
	b = int(a.split(' ')[0])
	c = int(a.split(' ')[1])
	current.append(b)
	available.append(c)
for i in range(x):
	if available[i] - current[i] > 1:
		y = y + 1
	else:
		pass
print(y)


from sys import stdin, exit
n = int(stdin.readline().rstrip())
total = 0
for line in stdin.readlines():
	(num_live, cap) = map(int, line.rstrip().split(' '))
	if cap - num_live >= 2:
		total += 1
print(total)


r = int(input())
count = 0
for _ in range(r):
	pc = list(map(int, input().rstrip().split()))
	(p, c) = pc
	left = c - p
	if left >= 2:
		count += 1
print(count)


n = int(input())
i = 0
j = 0
while i < n:
	str1 = input()
	b = str1.split(' ')
	if int(b[1]) - int(b[0]) >= 2:
		j += 1
	i += 1
print(j)


n = input()
count = 0
for i in range(1, int(n) + 1):
	(o, p) = input().split()
	o = int(o)
	p = int(p)
	if o == p:
		pass
	elif int(p - o) >= 2:
		count = count + 1
print(count)


n = int(input())
c = 0
for i in range(0, n):
	(x, y) = map(int, input().split())
	s = y - x
	if s >= 2:
		c = c + 1
print(c)


class room:

	def __init__(self, p, q):
		self.p = p
		self.q = q
n = int(input())
a = []
res = 0
for i in range(n):
	(p, q) = map(int, input().split())
	temp = room(p, q)
	a.append(temp)
for i in a:
	if i.q - i.p >= 2:
		res += 1
print(res)


n = int(input())
i = 0
s = []
while i < n:
	s.append(list(map(int, input().split())))
	i += 1
canLive = 0
for i in s:
	if i[1] - i[0] > 1:
		canLive += 1
print(canLive)


y = int(input())
output = 0
for i in range(y):
	all = [int(i) for i in input().split()]
	if all[1] - all[0] > 0 and all[1] - all[0] > 1:
		output += 1
print(output)


i = int(input())
j = 0
k = 0
while j < i:
	(x, y) = input().split()
	c = int(y) - int(x)
	if c >= 2:
		k += 1
	j += 1
print(k)


n = int(input())
y = 0
for i in range(n):
	s = input()
	z = s.split()
	if int(z[1]) - int(z[0]) >= 2:
		y += 1
print(y)


import functools
import logging
import os
import sys
import time
logger = logging.getLogger()
reader = sys.stdin
is_judge = os.getenv('DEBUGGING') is None

def timeit(func):

	@functools.wraps(func)
	def timed(*args, **kwargs):
		if is_judge:
			rv = func(*args, **kwargs)
		else:
			ts = time.time()
			rv = func(*args, **kwargs)
			te = time.time()
			logger.debug('performance %r %2.2fms', func.__name__, (te - ts) * 1000)
		return rv
	return timed

@timeit
def main():
	n = int(reader.readline())
	res = 0
	while n > 0:
		line = reader.readline().strip()
		if not line:
			break
		logger.debug(line)
		(p, q) = line.split(' ')
		p = int(p)
		q = int(q)
		if q - p >= 2:
			res += 1
	print(res)

def setup():
	global logger, reader
	if is_judge:
		logger.setLevel(logging.WARNING)
	else:
		handler = logging.StreamHandler(sys.stdout)
		handler.setLevel(logging.DEBUG)
		formatter = logging.Formatter('{asctime}s - {message}', style='{')
		handler.setFormatter(formatter)
		logger.addHandler(handler)
		logger.setLevel(logging.DEBUG)
		reader = open('input.txt')
setup()
try:
	main()
except KeyboardInterrupt:
	logger.debug('KeyboardInterrupt')
except IOError as e:
	logger.error(f'I/O error({e.errno}): {e.strerror}')


n = int(input())
c = 0
for i in range(n):
	mylist = list(map(int, input().split()))
	if mylist[1] - mylist[0] >= 2:
		c += 1
print(c)


x = int(input())
a = 0
for i in range(x):
	y = [int(a) for a in input().split()]
	b = y[0]
	c = y[1]
	if c - b >= 2:
		a += 1
print(a)


rooms = int(input())
accommodates = 0
for room in range(rooms):
	info = [int(r) for r in input().split()]
	if info[0] < info[1] - 1:
		accommodates += 1
print(accommodates)


n = int(input())
mat = [0] * n
c = 0
for i in range(n):
	mat[i] = list(map(int, input().split(' ')))
for i in range(n):
	if mat[i][1] - mat[i][0] > 1:
		c = c + 1
print(c)


x = int(input())
count = 0
for i in range(x):
	(a, b) = [int(a) for a in input().split()]
	if a < b:
		if a + 2 <= b:
			count += 1
print(count)


ty = int(input())
c = 0
for i in range(ty):
	(s, d) = list(map(int, input().split()))
	if d - s >= 2:
		c += 1
print(c)


import sys
import os

def int_array():
	return list(map(int, input().strip().split()))

def str_array():
	return input().strip().split()

def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)

def take_input():
	if os.environ.get('check'):
		sys.stdin = open('input.txt', 'r')
		sys.stdout = open('output.txt', 'w')
take_input()
count = 0
for _ in range(int(input())):
	(p, q) = int_array()
	if q - p >= 2:
		count += 1
print(count)


nb = 0
x = int(input())
for i in range(1, x + 1):
	(p, q) = map(int, input().split())
	if q - p > 1:
		nb = nb + 1
print(nb)


n = int(input())
p = 0
for i in range(n):
	(a, b) = map(int, input().split())
	m = b - a
	if m > 1:
		p = p + 1
print(p)


n = int(input())
Num = 0
for i in range(n):
	(p, q) = input().split(' ')
	if int(q) - int(p) >= 2:
		Num += 1
	else:
		Num = Num
print(Num)


s = int(input())
print(sum((eval(input().replace(' ', '-')) < -1 for i in range(s))))


n = int(input())
count = 0
for i in range(n):
	arr = list(map(int, input().split()))
	if arr[1] - arr[0] >= 2:
		count += 1
print(count)


n = int(input())
counter = 0
for i in range(n):
	args = list(map(int, input().split()))
	if args[1] - args[0] >= 2:
		counter += 1
print(counter)


room = int(input(''))
room_mem = []
count = 0
for i in range(0, room):
	x = input('')
	room_me = x.split(' ')
	for j in range(0, 2):
		room_mem.append(int(room_me[j]))
	if room_mem[1] - room_mem[0] >= 2:
		count += 1
	room_mem = []
print(count)


n = int(input())
a = []
z = 0
for i in range(n):
	a.append(list(map(int, input().split())))
for i in range(n):
	if a[i][1] - 2 >= a[i][0]:
		z = z + 1
print(z)


t = int(input())
count = 0
while t != 0:
	(p, q) = list(map(int, input().strip().split()))
	if q - p >= 2:
		count = count + 1
	t = t - 1
print(count)


n = int(input())
c = 0
for i in range(n):
	(p, q) = [int(m) for m in input().split()]
	if q - p > 1:
		c += 1
print(c)


a = int(input())
b = []
result = 0
for x in range(a):
	b.append(list(map(int, input().split())))
	if b[x][1] - b[x][0] >= 2:
		result = result + 1
	else:
		result = result + 0
print(result)


def solve():
	n = int(input())
	ans = 0
	for i in range(n):
		(a, b) = [int(s) for s in input().split()]
		if b - a >= 2:
			ans += 1
	print(ans)
solve()


rooms = int(input())
i = 0
num_possible = []
while i < rooms:
	capacity = input().split()
	num_possible.append(int(capacity[1]) - int(capacity[0]))
	i += 1
num_suitable = 0
for element in num_possible:
	if element >= 2:
		num_suitable += 1
print(num_suitable)


n = int(input())
count = 0
li = []
for i in range(0, n):
	(a, b) = list(map(int, input().split()))
	li.append(a)
	li.append(b)
for i in range(0, len(li), 2):
	if abs(li[i] - li[i + 1]) >= 2:
		count = count + 1
print(count)


n = int(input())
rooms = []
count = 0
for i in range(n):
	rooms.append(input())
for i in rooms:
	aux = i.split(' ')
	if int(aux[1]) - int(aux[0]) >= 2:
		count += 1
print(count)


count = 0
for i in range(int(input())):
	(p, q) = [int(x) for x in input().split()]
	if p < q and q - p >= 2:
		count += 1
print(count)


n = int(input())
rooms = []
count = 0
for i in range(n):
	rooms.append(list(map(int, input().split())))
for i in range(n):
	if rooms[i][1] - rooms[i][0] > 1:
		count += 1
print(count)


n = int(input())
nb = 0
for _ in range(n):
	ch = list(input().split())
	(a, b) = (int(ch[0]), int(ch[1]))
	if abs(a - b) >= 2:
		nb += 1
print(nb)


def read_array():
	x = []
	x1 = []
	x = input()
	x = x.split(' ')
	for r in range(len(x)):
		x1.append(int(x[r]))
	return x1
m = int(input())
count = 0
for r in range(m):
	x = read_array()
	if x[1] - x[0] >= 2:
		count += 1
print(count)


n = int(input())
lis = []
for i in range(n):
	lis.append(input().split())
lis1 = []
for i in range(n):
	lis1 += lis[i]
for i in range(len(lis1)):
	lis1[i] = int(lis1[i])
count = 0
for i in range(0, 2 * n - 1, 2):
	if lis1[i + 1] - lis1[i] >= 2:
		count += 1
print(count)


x = int(input())
javab = 0
for i in range(x):
	y = list(map(int, input().split()))
	if y[1] - y[0] >= 2:
		javab += 1
	else:
		continue
print(javab)


N = int(input())
c = 0
for i in range(N):
	(t1, t2) = map(int, input().split())
	if t2 - t1 >= 2:
		c = c + 1
print(c)


n = int(input())
r = 0
for i in range(n):
	(c, a) = [int(x) for x in input().split(' ')]
	if a - c >= 2:
		r += 1
print(r)


def s():
	n = int(input())
	ans = 0
	for i in range(n):
		(p, q) = [int(x) for x in input().split()]
		if p + 2 <= q:
			ans += 1
	print(ans)
s()


line = input()
count = 0
for i in range(0, int(line)):
	line2 = input()
	live_man = int(line2.split(' ')[0])
	capacity = int(line2.split(' ')[1])
	if capacity - live_man >= 2:
		count += 1
print(count)


import sys
from math import sqrt
inp = sys.stdin.readline
read = lambda : list(map(int, inp().split()))

def solve():
	c = 0
	for _ in range(int(inp())):
		(a, b) = read()
		c += 1 if a <= b - 2 else 0
	print(c)
solve()


n = int(input())
count = 0
for i in range(n):
	var = input()
	(x, y) = map(int, var.split())
	if y - x >= 2:
		count += 1
print(count)


n = int(input())
s = 0
while n > 0:
	l = input().split()
	a = int(l[0])
	b = int(l[1])
	if b - a >= 2:
		s += 1
	n = n - 1
print(s)


a = int(input())
ch = 0
for i in range(a):
	b = [int(i) for i in input().split()]
	if max(b) - min(b) >= 2:
		ch += 1
print(ch)


r = 0
for i in range(int(input())):
	(n, m) = map(int, input().split())
	if m >= n + 2:
		r = r + 1
print(r)


t = int(input())
c = 0
for _ in range(t):
	(a1, b1) = map(int, input().split())
	if b1 - a1 >= 2:
		c += 1
print(c)


import sys

def solve():
	n = int(input())
	ans = 0
	for i in range(n):
		(pi, qi) = map(int, input().split())
		if pi + 2 <= qi:
			ans += 1
	print(ans)
solve()


n = int(input())
l1 = []
l2 = []
for i in range(n):
	(a, b) = input().split(' ')
	l1.append(int(a))
	l2.append(int(b))
ct = 0
for i in range(0, n):
	if l2[i] - l1[i] >= 2:
		ct += 1
print(ct)


n = int(input())
suitable_rooms = 0
for i in range(n):
	(p, q) = map(int, input().split())
	if q - p == 2 or q - p > 2:
		suitable_rooms += 1
	else:
		None
print(suitable_rooms)


x = int(input())
print(sum((eval(input().replace(' ', '-')) < -1 for i in range(x))))


rooms = int(input())
sizes = [[int(f) for f in input().split(' ')] for n in range(rooms)]
good = 0
for r in sizes:
	if r[0] + 2 <= r[1]:
		good += 1
print(good)


n = int(input(''))
cont = 0
for k in range(n):
	(a, b) = map(int, input().split(' '))
	if b - a >= 2:
		cont += 1
print(cont)


i = int(input())
a = 0
for j in range(i):
	(pi, qi) = input().split()
	if pi != qi and int(qi) - int(pi) >= 2:
		a += 1
print(a)


counter = int(input())
count = 0
for _ in range(counter):
	arr = list(map(int, input().split()))
	if arr[1] - arr[0] >= 2:
		count += 1
print(count)


from sys import stdin
n = int(stdin.readline())
count = 0
for _ in range(n):
	(a, b) = map(int, stdin.readline().split())
	if b - a >= 2:
		count += 1
print(count)


n = int(input(''))
i = 0
s = 0
while i < n:
	lis = list(map(int, input('').split()))
	if lis[1] - lis[0] >= 2:
		s += 1
	else:
		s = s
	i += 1
print(s)


n = int(input())
s = 0
for i in range(n):
	(a, b) = map(int, input().split())
	if b - a >= 2:
		s = s + 1
	else:
		pass
print(s)


NoOfRooms = int(input())
FreeRooms = 0
for i in range(0, NoOfRooms):
	(LivingPeople, RoomCapacity) = input().split()
	(LivingPeople, RoomCapacity) = [int(LivingPeople), int(RoomCapacity)]
	if LivingPeople < RoomCapacity and RoomCapacity - LivingPeople >= 2:
		FreeRooms += 1
print(FreeRooms)


import sys
n = input()
c = int(0)
for x in range(int(n)):
	x = input().split()
	if int(x[1]) - int(x[0]) >= 2:
		c = c + 1
print(c)


t = int(input())
ans = 0
while t:
	t -= 1
	(p, q) = map(int, input().split())
	if q - p >= 2:
		ans += 1
print(ans)


otv = 0
for i in range(int(input())):
	room = input().split(' ')
	if int(room[1]) - int(room[0]) >= 2:
		otv += 1
print(otv)


def solve():
	rooms = int(input())
	i = 0
	for _ in range(rooms):
		d = list(map(int, input().split()))
		acc = d[1]
		people = d[0]
		if acc - people >= 2:
			i += 1
	print(i)
solve()


fre = int(input())
ans = 0
l = []
for f in range(fre):
	n = list(map(int, input().split()))
	if n[1] - n[0] >= 2:
		ans += 1
print(ans)


n = int(input())
counter = 0
for i in range(n):
	a = [int(i) for i in input().split()]
	if a[1] - a[0] > 1:
		counter += 1
print(counter)


NumberOfRooms = int(input())
Inhabitants = []
for Counter in range(NumberOfRooms):
	Inhabitants.append(tuple(map(int, input().split(' '))))
EligibleRooms = 0
for (Living, Maximal) in Inhabitants:
	if Maximal - Living >= 2:
		EligibleRooms += 1
print(EligibleRooms)


from typing import List, Tuple
Rooms = List[Tuple[int, ...]]

def parseStdin() -> Rooms:
	n = int(input())
	return [tuple(map(int, input().split())) for _ in range(n)]

def solve(data: Rooms) -> int:
	c = 0
	for (x, y) in data:
		c += y - x >= 2
	return c
data = parseStdin()
print(solve(data))


count = 0
for _ in range(int(input())):
	(n, m) = map(int, input().split())
	if abs(n - m) >= 2:
		count += 1
print(count)


n = int(input())
can_leave = 0
for i in range(n):
	(occ, tot) = map(int, input().split())
	if tot - occ >= 2:
		can_leave += 1
print(can_leave)


from sys import stdin

def main():
	n = int(stdin.readline())
	cont = 0
	for i in range(n):
		(pi, qi) = [int(i) for i in stdin.readline().strip().split()]
		if qi - pi >= 2:
			cont += 1
	print(cont)
main()


print(sum((eval(f'{b}-{a}') > 1 for (a, b) in [input().split() for _ in ' ' * int(input())])))


n = int(input())
a = 0
for i in range(n):
	(pi, qi) = [int(i) for i in input().split(' ')]
	if qi >= pi + 2:
		a += 1
print(a)


a = int(input())
inputs = []
n = 0
while n < a:
	y = input()
	n += 1
	inputs.append(y)
count = 0
for i in inputs:
	b = i.split()
	if int(b[1]) - int(b[0]) >= 2:
		count += 1
print(count)


n = int(input())
cc = 0
for i in range(n):
	(aa, bb) = [int(x) for x in input().split()]
	if bb - aa >= 2:
		cc = cc + 1
	else:
		cc = cc
print(cc)


n = int(input())
p = []
q = []
for x in range(n):
	(a, b) = input().split(' ')
	p.append(int(a))
	q.append(int(b))
x = 0
c = 0
for x in range(n):
	if p[x] <= q[x] - 2:
		c += 1
print(c)


(x, y, count) = (int(input()), [], 0)
for _ in range(x):
	(i, j) = [int(i) for i in input().split()]
	y.append((i, j))
for (i, j) in y:
	if j - i >= 2:
		count += 1
print(count)


n = int(input())
count = 0
for i in range(n):
	(p, q) = map(int, input().split())
	if p == q or abs(p - q) < 2:
		continue
	elif abs(p - q) >= 2:
		count += 1
print(count)


no_of_rooms = int(input())
room_details = []
for i in range(no_of_rooms):
	room_detail = list(map(int, input().split()))
	room_details.append(room_detail)
rooms_accomodable = 0
for room in room_details:
	room_capacity = room[1] - room[0]
	if room_capacity >= 2:
		rooms_accomodable += 1
print(rooms_accomodable)


n = int(input())
a = 0
c = 0
while n:
	n -= 1
	(x, y) = [int(i) for i in input().split()]
	a = y - x
	if a >= 2:
		c += 1
print(c)


n = int(input())
rooms = []
for i in range(n):
	rooms.append(list(map(lambda x: int(x), input().split())))
available = [x for x in rooms if x[1] - x[0] >= 2]
print(len(available))


__author__ = 'curiousfool'
t = int(input())
count = 0
for i in range(0, t):
	n = list(map(int, input().split()))
	if n[1] - n[0] >= 2:
		count += 1
print(count)


t = int(input())
c = 0
for _ in range(t):
	(a, b) = map(int, input().split())
	if b - a > 1:
		c = c + 1
		pass
	pass
print(c)


t = int(input())
c = 0
for z in range(t):
	(a, b) = map(int, input().split())
	if abs(a - b) >= 2:
		c = c + 1
print(c)


x = int(input())
count = 0
for i in range(x):
	inp = list(map(int, input().split()))
	(p, c) = inp[:]
	if c - p >= 2:
		count += 1
print(count)


count = 0
for _ in range(int(input())):
	data = input().split()
	if int(data[1]) - int(data[0]) >= 2:
		count += 1
	else:
		pass
print(count)


n = int(input())
c = 0
for _ in range(n):
	(m, n) = list(map(int, input().split()))
	if n - m >= 2:
		c = c + 1
print(c)


n = int(input())
c = 0
for _ in range(n):
	(a, b) = map(int, input().split())
	free = 0
	if b - a >= 2:
		c += 1
print(c)


t = int(input())
count = 0
for i in range(t):
	(n, k) = map(int, input().split())
	if k - n >= 2:
		count += 1
print(count)


a = int(input())
l = []
c = 0
for i in range(a):
	x = list(map(int, input().split()))
	l.append(x)
for i in range(a):
	if l[i][1] - l[i][0] > 1:
		c += 1
if c > 0:
	print(c)
else:
	print(0)


n = int(input())
number = 0
for _ in range(n):
	tempS = input().split(sep=' ')
	if int(tempS[1]) - int(tempS[0]) >= 2:
		number += 1
print(number)


n = int(input())
count = 0
for i in range(n):
	str_input = str(input())
	list_input = str_input.split(' ')
	if int(list_input[1]) - int(list_input[0]) >= 2:
		count += 1
print(count)


list1 = []
for i in range(int(input())):
	list1.append(list(map(int, input().split())))
b = list(filter(lambda x: x[0] + 2 <= x[1], list1))
print(len(b))


n = int(input())
people = []
total = []
count = 0
for i in range(n):
	x = list(input().split())
	people.append(int(x[0]))
	total.append(int(x[1]))
for i in range(len(people)):
	if total[i] - people[i] >= 2:
		count += 1
print(count)


n = int(input())
c = 0
for i in range(0, n):
	(l1, l2) = input().split()
	l = int(l1)
	m = int(l2)
	if m - l >= 2:
		c = c + 1
print(c)


n = int(input())
l = []
for i in range(n):
	(a, b) = [int(i) for i in input().split()]
	l.append(b - a)
print(len(list(filter(lambda x: x >= 2, l))))


t = int(input())
c = 0
for i in range(t):
	(a, b) = [int(x) for x in input().split()]
	if a < b and b - a >= 2:
		c = c + 1
print(c)


n = int(input())
total = 0
for i in range(n):
	current_room = input().split()
	if int(current_room[1]) - int(current_room[0]) >= 2:
		total += 1
print(total)


import sys
number_of_rooms = int(input())
count = 0
while number_of_rooms > 0:
	p_and_q = input().split()
	(p, q) = (int(p_and_q[0]), int(p_and_q[1]))
	if q - p >= 2:
		count += 1
	number_of_rooms -= 1
print(count)


rooms = int(input())
count = 0
livable = 0
while count < rooms:
	roomers = input().split(' ')
	inRoom = roomers[0]
	roomCapacity = roomers[1]
	if int(inRoom) < int(roomCapacity) and int(roomCapacity) - int(inRoom) >= 2:
		livable += 1
	count += 1
print(livable)


n = int(input())
for _ in range(n):
	(p, q) = map(int, input().split())
	if not p < q - 1:
		n -= 1
print(n)


class CodeforcesTask467ASolution:

	def __init__(self):
		self.result = ''
		self.room_count = 0
		self.rooms = []

	def read_input(self):
		self.room_count = int(input())
		for x in range(self.room_count):
			self.rooms.append([int(x) for x in input().split(' ')])

	def process_task(self):
		rooms_free = [x[1] - x[0] for x in self.rooms]
		poss = [1 if x >= 2 else 0 for x in rooms_free]
		self.result = str(sum(poss))

	def get_result(self):
		return self.result
Solution = CodeforcesTask467ASolution()
Solution.read_input()
Solution.process_task()
print(Solution.get_result())


n = int(input())
ans = 0
for _ in range(n):
	(a, b) = map(int, input().split())
	if b - a > 1:
		ans += 1
print(ans)


n = int(input())
l1 = []
l2 = []
c = 0
for i in range(n):
	l1 = list(map(int, input().split()))
	l2.insert(i, l1)
for i in l2:
	if abs(i[0] - i[1]) > 1:
		c = c + 1
print(c)


n = int(input())
rooms = []
for i in range(n):
	rooms.append(list(map(int, input().split())))
print(sum([1 for room in rooms if room[1] - room[0] >= 2]), end='')


count = 0
for i in range(int(input())):
	x = list(map(int, input().split(' ')))
	if x[1] - x[0] >= 2:
		count += 1
print(count)


print(sum((1 for (p, q) in [map(int, input().split()) for _ in [0] * int(input())] if q - p > 1)))


n = int(input(''))
count = 0
for i in range(0, n):
	snum = input('')
	(p, q) = snum.split(' ')
	(p, q) = (int(p), int(q))
	if q - p >= 2:
		count += 1
print(count)


r = int(input())
count = 0
while r:
	(x, y) = input().split(' ')
	z = int(y) - int(x)
	if z >= 2:
		count = count + 1
	r -= 1
print(count)


n = int(input())
s = 0
for i in range(n):
	(p, q) = input().split()
	p = int(p)
	q = int(q)
	if p == q:
		pass
	elif abs(p - q) >= 2:
		s += 1
print(s)


n = int(input())
room = None
counter = 0
for i in range(0, n):
	room = tuple(map(int, input().split()))
	if room[0] + 2 <= room[1]:
		counter += 1
print(counter)


n = int(input())
z = 0
for i in range(n):
	a = [int(e) for e in input().split()]
	if a[1] - a[0] > 1:
		z += 1
print(z)


ans = 0
for _ in range(int(input())):
	lol = [int(x) for x in input().split()]
	p = lol[0]
	q = lol[1]
	if q - p >= 2:
		ans += 1
print(ans)


count = 0
for a in range(int(input())):
	sa = list(map(int, input().split()))
	if sa[1] - sa[0] >= 2:
		count += 1
print(count)


n = int(input())
cnt = 0
while n:
	n = n - 1
	s = input()
	s = s.split()
	s = list(map(int, s))
	if s[1] - s[0] >= 2:
		cnt = cnt + 1
print(cnt)


batas = int(input())
tot = 0
arr = []
for i in range(batas):
	kamar = input().split(' ')
	x = len(kamar)
	for j in range(len(kamar) - 1):
		if int(kamar[j + 1]) - int(kamar[j]) >= 2:
			tot += 1
		else:
			tot += 0
print(tot)


n = int(input())
i = 0
rooms = 0
while i < n:
	(p, q) = list(map(int, input().split()))
	x = q - p
	if x >= 2:
		rooms += 1
	i += 1
print(rooms)


n = int(input())
count = 0
for i in range(n):
	(number_of_people, rooom_capacity) = map(int, input().split())
	if rooom_capacity - number_of_people >= 2:
		count += 1
print(count)


k = 0
for i in range(int(input())):
	q = list(map(int, input().split()))
	if q[1] - q[0] > 1:
		k += 1
print(k)


n = int(input())
count = 0
for _ in range(1, n + 1):
	(p_i, q_i) = map(int, input().split())
	if q_i - p_i >= 2:
		count += 1
print(count)


n = int(input())
s = 0
for i in range(n):
	(a, b) = (int(j) for j in input().split())
	if a + 2 <= b:
		s += 1
print(s)


n = int(input())
vag = 0
while n > 0:
	n = n - 1
	s = input().split(' ')
	p = int(s[0])
	q = int(s[1])
	if q - p >= 2:
		vag = vag + 1
print(vag)


n = int(input())
c = 0
while n > 0:
	x = list(map(int, input().split()))
	if x[1] - x[0] >= 2:
		c += 1
	n -= 1
print(c)


n = int(input())
count = 0
for i in range(n):
	(n1, n2) = map(int, input().split())
	if n2 - n1 >= 2:
		count += 1
print(count)


t = int(input())
c = 0
while t:
	t -= 1
	(p, q) = [int(i) for i in input().split()]
	if q - p >= 2:
		c += 1
print(c)


n = input()
n = int(n)
i = 0
count = 0
while i < n:
	a = input()
	(p, q) = a.split()
	p = int(p)
	q = int(q)
	if q - p >= 2:
		count = count + 1
	i = i + 1
print(count)


class phong:

	def __init__(self, n, ls):
		self.n = n
		self.ls = ls
		self.s = 0

	def sophong(self):
		for i in range(self.n):
			if self.ls[i][0] + 2 <= self.ls[i][1]:
				self.s += 1
		return self.s

	def print(self):
		print(self.sophong())

def main():
	n = int(input())
	ls = []
	for i in range(n):
		ls.append(list(map(int, input().split())))
	room = phong(n, ls)
	room.print()
main()


import math
import os
import random
import re
import sys
n = int(input())
c = 0
for x in range(n):
	(p, q) = map(int, input().rstrip().split())
	if q - p >= 2:
		c = c + 1
print(c)


t = int(input())
count = 0
for j in range(t):
	(p, q) = list(map(int, input().split()))
	if q - p >= 2:
		count = count + 1
print(count)


n = int(input())
a = 0
for i in range(n):
	(x, y) = map(int, input().split())
	a += y - x >= 2
print(a)


import sys
input = sys.stdin.readline

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())
n = inp()
r = 0
for i in range(n):
	(p, q) = invr()
	if q - p >= 2:
		r += 1
print(r)


ent = int(input())
result = 0
for i in range(ent):
	sol = input().split(' ')
	res = int(sol[1]) - int(sol[0])
	if res > 0 and res >= 2:
		result += 1
	else:
		continue
print(result)


number = int(input())
count = 0
for i in range(number):
	x = input().split()
	x = [int(i) for i in x]
	if x[0] == x[1] - 1 or x[0] == x[1]:
		count = count
	else:
		count = count + 1
print(count)


import math
from fractions import Fraction as frac
MOD = 1000000000.0 + 7

def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)

def lcm(a, b):
	return a * b // gcd(a, b)

def no():
	print('NO')
	return

def yes():
	print('YES')
	return

def solve(case_no):
	n = int(input())
	cnt = 0
	while n > 0:
		n -= 1
		(a, b) = map(int, input().split())
		if a + 2 <= b:
			cnt += 1
	print(cnt)
t = 1
for i in range(1, t + 1):
	solve(i)


from sys import stdin
input = stdin.readline

def george(n):
	return sum(((lambda p, q: p - q <= -2)(*map(int, input().split())) for _ in range(n)))
print(george(int(input())))


ans = 0
n = int(input())
for i in range(n):
	(a, b) = map(int, input().split())
	if b - a >= 2:
		ans = ans + 1
print(ans, end='')


n = int(input())
counter = 0
p = []
q = []
for i in range(n):
	(a, b) = input().split()
	p.append(int(a))
	q.append(int(b))
for i in range(n):
	if q[i] - p[i] >= 2:
		counter += 1
print(counter)


n = int(input())
s = [list(map(int, input().split())) for i in range(n)]
d = [1 for x in s if x[1] - x[0] >= 2]
print(sum(d))


n = int(input(''))
mat = []
count = 0
for i in range(n):
	list1 = list(map(int, input().split()))
	mat.append(list1)
for i in mat:
	if i[1] - i[0] >= 2:
		count += 1
	else:
		continue
print(count)


g = int(input())
c = 0
for _ in range(g):
	(j, b) = [int(i) for i in input().split()]
	if j + 1 < b:
		c += 1
print(c)


room = input('')
n = int(room)
i = 0
count = 0
while i < n:
	a = input('')
	(b, c) = a.split()
	p = int(b)
	q = int(c)
	if q - p > 1:
		count = count + 1
	i = i + 1
print(count)


def main():
	a = int(input())
	counter = 0
	for x in range(0, a):
		dorms = input().split(' ')
		dorms = [int(x) for x in dorms]
		if dorms[1] - dorms[0] >= 2:
			counter += 1
	print(counter)
main()


n = int(input())
sp = []
w = 0
for i in range(n):
	a = list(map(int, input().split()))
	sp.append(a)
for k in range(n):
	if sp[k][1] - sp[k][0] >= 2:
		w += 1
print(w)


n = int(input())
x = []
for i in range(n):
	(p, q) = map(int, input().split())
	x.append(q - p)
ans = list(filter(lambda x: x >= 2, x))
print(len(ans))


n = int(input())
L = []
for _ in range(n):
	S = input().split(' ')
	S[0] = int(S[0])
	S[1] = int(S[1])
	L.append(S)
count = 0
for i in range(n):
	if L[i][1] - L[i][0] >= 2:
		count += 1
print(count)


x = int(input())
c = 0
for i in range(1, x + 1, 1):
	(a, b) = input().split(' ')
	r = abs(int(a) - int(b))
	if r >= 2:
		c = c + 1
print(c)


def main():
	t = int(input())
	c = 0
	for _ in range(t):
		(x, y) = [int(i) for i in input().split()]
		if y - x >= 2:
			c += 1
	print(c)
main()


n = int(input())
d = 0
for t in range(n):
	(p, q) = map(int, input().split())
	if q - p >= 2:
		d += 1
print(d)


rooms = int(input())
ans = 0
for i in range(rooms):
	(live, cap) = map(int, input().split())
	if cap - live >= 2:
		ans += 1
print(ans)


count = int(input())
rooms = []
count_room = 0
i = 0
while i < count:
	rooms.append(list(input().split(' ')))
	i += 1
for room in rooms:
	rest = int(room[1]) - int(room[0])
	if rest >= 2:
		count_room += 1
print(count_room)


n = int(input())
room = 0
for i in range(n):
	l = list(input().split())
	p = int(l[0])
	q = int(l[1])
	if q - p >= 2:
		room += 1
print(room)


n = int(input())
p = 0
q = 0
i = 0
for a in range(n):
	s = input().split()
	p = int(s[0])
	q = int(s[1])
	if q - p > 1:
		i += 1
print(i)


n = int(input())
count = 0
while n:
	(p, q) = [int(p) for p in input().split()]
	if q - p >= 2:
		count += 1
	n -= 1
print(count)


tc = int(input())
cnt = 0
while tc > 0:
	tc = tc - 1
	(a, b) = [int(x) for x in input().split()]
	if b - a >= 2:
		cnt = cnt + 1
print(cnt)


n = int(input())
p = list()
q = list()
ans = 0
for k in range(n):
	(i, j) = input().split(' ')
	p.append(i)
	q.append(j)
for i in range(n):
	if int(q[i]) - int(p[i]) > 1:
		ans += 1
print(ans)


m = int(input(''))
a = {}
b = {}
ans = 0
for i in range(m):
	c = input('')
	(a[i], b[i]) = c.split()
	a[i] = int(a[i])
	b[i] = int(b[i])
	if b[i] - a[i] >= 2:
		ans += 1
print(ans)


def solve():
	n = int(input())
	count = 0
	for i in range(n):
		(p, q) = map(int, input().split())
		if q - p >= 2:
			count += 1
	print(count)
solve()


n = int(input())
c = 0
while n > 0:
	(t, q) = [int(x) for x in input().split()]
	if q - t >= 2:
		c += 1
	n -= 1
print(c)


rooms = int(input())
x = 0
for n in range(rooms):
	room_1 = str(input())
	roomlist = room_1.split(' ')
	cur = int(roomlist[0])
	tot = int(roomlist[1])
	if cur < int(tot - 1):
		x += 1
print(x)


a = int(input())
h = 0
for i in range(a):
	(k, m) = map(int, input().split())
	if m - k >= 2:
		h += 1
print(h)


n = int(input())
num = 0
for i in range(n):
	(p, q) = [int(x) for x in input().split()]
	a = q - p
	if a > 1:
		num += 1
print(num)


n = int(input())
c = 0
i = 0
while i < n:
	(x, y) = input().split()
	x = int(x)
	y = int(y)
	z = y - x
	if z >= 2:
		c = c + 1
	i = i + 1
print(c)


t = int(input())
cnt = 0
for _ in range(t):
	(p, q) = map(int, input().split())
	diff = q - p
	if diff >= 2:
		cnt += 1
print(cnt)


def main():
	(n,) = get_ints()
	result = 0
	for i in range(n):
		(p, q) = get_ints()
		if q - p >= 2:
			result += 1
	print(result)

def get_ints():
	return (int(x) for x in input().split(' '))
main()


(x, c) = (int(input()), 0)
for i in range(x):
	y = input().split(' ')
	y = [int(j) for j in y]
	if y[1] - y[0] > 1:
		c += 1
print(c)


p = int(input())
count = 0
while p > 0:
	(n1, m1) = input().split()
	m = int(m1)
	n = int(n1)
	if m - n >= 2:
		count = count + 1
	p = p - 1
print(count)


c = 0
for _ in range(int(input())):
	k = input().split()
	if int(k[1]) - int(k[0]) >= 2:
		c += 1
print(c)


x = 0
for i in range(int(input())):
	w = input().split()
	if int(w[0]) < int(w[1]) - 1:
		x += 1
print(x)


n = int(input())
res = 0
for i in range(n):
	(x, y) = map(int, input().split(' '))
	if x + 2 <= y:
		res += 1
print(res)


c = 0
for _ in range(int(input())):
	l = [int(i) for i in input().split()]
	diff = l[1] - l[0]
	if diff >= 2:
		c += 1
print(c)


n = int(input())
c = 0
for i in range(n):
	(s, m) = list(map(int, input().split()))
	if m - s >= 2:
		c += 1
print(c)


n = int(input())
lists = []
count = 0
for i in range(n):
	t = list(map(int, input().rstrip().split()))
	if t[1] - t[0] >= 2:
		count += 1
print(count)


n = int(input())
result = 0
for i in range(n):
	a = list(map(int, input().split()))
	p = a[0]
	q = a[1]
	if p == q or q - p < 2:
		pass
	else:
		result += 1
print(result)


n = int(input())
c = 0
for _ in range(n):
	(x, y) = list(map(int, input().split()))
	if y - x >= 2:
		c += 1
print(c)


n = int(input())
ans = 0
for i in range(n):
	(people, capacity) = map(int, input().split())
	if capacity - people > 1:
		ans += 1
print(ans)


count = 0
for x in range(int(input())):
	n = input()
	t = []
	for i in range(len(n)):
		if n[i] == ' ':
			t.append(n[:i])
			t.append(n[i + 1:])
			break
	if int(t[1]) - int(t[0]) >= 2:
		count += 1
print(count)


n = int(input())
c = 0
for i in range(n):
	(p, q) = map(int, input().split())
	if q - p > 1 or p - q > 1:
		c = c + 1
print(c)


n = int(input())
count = 0
for i in range(n):
	k = list(map(int, input().split()))
	if k[1] - k[0] > 1:
		count += 1
print(count)


number = int(input())
result = 0
for m in range(number):
	(a, b) = map(int, input().split())
	if b - a >= 2 and b >= a:
		result += 1
print(result)


count = int(input())
result = 0
for i in range(count):
	l = input().split()
	if int(l[1]) - int(l[0]) >= 2:
		result += 1
print(result)


n = int(input())
g = 0
for m in range(n):
	(p, q) = map(int, input().split())
	f = q - p
	if f > 1:
		g += 1
print(g)


cnt = 0
for i in range(int(input())):
	room = tuple(map(int, input().split()))
	if room[0] <= room[1] - 2:
		cnt += 1
print(cnt)


n = int(input())
nr = 0
for i in range(n):
	(p, c) = input().split()
	p = int(p)
	c = int(c)
	v = c - p
	if v >= 2:
		nr += 1
print(nr)


a = int(input())
d = 0
for i in range(a):
	(a, b) = [int(i) for i in input().split()]
	if b - a > 1:
		d += 1
print(d)


n = int(input())
Result = 0
for i in range(n):
	(Rez, Cap) = input().split()
	Rez = int(Rez)
	Cap = int(Cap)
	if Cap - Rez >= 2:
		Result += 1
print(Result)


n = int(input())
co = 0
for i in range(n):
	x = input()
	x = x.split()
	if int(x[0]) + 2 <= int(x[1]):
		co = co + 1
print(co)


import sys, os.path
if os.path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
sys.setrecursionlimit(10 ** 5)

def i():
	return sys.stdin.readline().strip()

def ii():
	return int(sys.stdin.readline())

def li():
	return list(sys.stdin.readline().strip())

def mii():
	return map(int, sys.stdin.readline().split())

def lii():
	return list(map(int, sys.stdin.readline().strip().split()))

def solve():
	a = ii()
	c = 0
	for i in range(a):
		(p, q) = mii()
		if q - p >= 2:
			c += 1
	print(c)
solve()


n = input()
n = int(n)
l = [input().split() for i in range(n)]
x = 0
i = 0
while i < n:
	if int(l[i][1]) - int(l[i][0]) >= 2:
		x += 1
	i += 1
print(x)


n = int(input())
ar = 0
for i in range(n):
	room = list(map(int, input().split()))
	cur = int(room[0])
	cap = int(room[1])
	if cap - cur > 1:
		ar += 1
print(str(ar))


def game_result(count):
	result = 0
	for i in range(count):
		(line1, line2) = map(int, input().split())
		if line2 - line1 >= 2:
			result += 1
	print(result)
game_start = input()
game_result(int(game_start))


_n = int(input())
count = 0
for i in range(_n):
	room = input().split(' ')
	if int(room[1]) - int(room[0]) >= 2:
		count += 1
print(count)


n = int(input())
i = 0
c = 0
while i < n:
	a = [int(j) for j in input().split(' ')]
	if a[1] - a[0] >= 2:
		c += 1
	i += 1
print(c)


n = int(input())
k = 0
for i in range(n):
	s = list(map(int, input().split()))
	if s[1] - s[0] >= 2:
		k += 1
print(k)


count = 0
for room in range(int(input())):
	(p, q) = map(int, input().split())
	if q - p >= 2:
		count += 1
print(count)


from sys import stdin
sum = 0
n = int(input())
for i in range(n):
	a = [int(x) for x in stdin.readline().split()]
	if a[1] - a[0] >= 2:
		sum += 1
print(sum)


n = int(input())
x = 0
for i in range(n):
	(t, k) = list(map(int, input().split()))
	if t >= k or k - t == 1:
		x += 1
print(n - x)


n = int(input())
p = 0
q = 0
quantity = 0
for i in range(n):
	(p, q) = map(int, input().split())
	free = q - p
	if free >= 2:
		quantity += 1
print(quantity)


a = int(input())
b = 0
for i in range(a):
	(q, w) = list(map(int, input().split()))
	if w - q >= 2:
		b += 1
print(b)


lst = []

def acc(s, t):
	l = t - s
	if l >= 2:
		lst.append('0')
n = int(input())
for i in range(n):
	(p, q) = list(map(int, input().strip().split()))
	acc(p, q)
print(len(lst))


counter = 0
for i in range(int(input())):
	bruh = input().split()
	if int(bruh[1]) > int(bruh[0]) + 1:
		counter += 1
print(counter)


t = int(input())
c = 0
for i in range(t):
	(p, q) = map(int, input().split())
	if q - p > 1:
		c += 1
	else:
		continue
print(c)


def func(n):
	l1 = [list(map(int, i)) for i in [input().split() for _ in range(n)]]
	final = [i[1] - i[0] for i in l1]
	ans = [k for k in final if k >= 2]
	return len(ans)
print(func(int(input())))


def main():
	n = int(input())
	out = 0
	for _ in range(n):
		(a, b) = map(int, input().split())
		if b - a > 1:
			out += 1
	print(out)
main()


def f(lst):
	return len([i for i in lst if i[1] - i[0] != 0 and i[1] - i[0] >= 2])
lst = list()
for i in range(int(input())):
	lst.append(tuple(map(int, input().split())))
print(f(lst))


num = 0
N = int(input())
while N:
	N -= 1
	(p, q) = [int(i) for i in input().split()]
	if q - p >= 2:
		num += 1
print(num)


n = int(input())
p = []
q = []
c = 0
for i in range(n):
	(x, y) = map(int, input().split())
	p.append(x)
	q.append(y)
for i in range(len(p)):
	for j in range(len(q)):
		if i == j:
			if p[i] < q[j] and q[j] - p[i] >= 2:
				c += 1
print(c)


def main():
	num_rooms = int(input())
	available_rooms = 0
	for _ in range(num_rooms):
		(in_room, allowed) = map(int, input().split())
		if allowed - in_room >= 2:
			available_rooms += 1
	print(available_rooms)
main()


n = int(input())
P = []
Q = []
for i in range(n):
	(p, q) = map(int, input().split())
	P.append(p)
	Q.append(q)
count = 0
for i in range(n):
	if Q[i] - P[i] >= 2:
		count += 1
print(count)


a = []
for i in range(int(input())):
	a.append([int(x) for x in input().split()])
r = 0
for i in range(len(a)):
	if a[i][1] - a[i][0] > 1:
		r += 1
print(r)


n = int(input())
count = 0
while n > 0:
	(a, b) = tuple(input().split(' '))
	if int(b) - int(a) >= 2:
		count += 1
	n -= 1
print(count)


rooms = int(input())
counter = 0
for i in range(rooms):
	aList = input().split(' ')
	for i in range(len(aList)):
		aList[i] = int(aList[i])
	if aList[1] - aList[0] >= 2:
		counter += 1
print(counter)


rooms = int(input())
occupied = []
capacity = []
for i in range(rooms):
	(a, b) = input().split()
	occupied.append(a)
	capacity.append(b)
roomVacancy = 0
for i in range(rooms):
	if int(capacity[i]) - int(occupied[i]) >= 2:
		roomVacancy += 1
print(roomVacancy)


n = int(input())
rooms = 0
for x in range(n):
	(a, b) = list(map(int, input().split(' ')))
	if b - a >= 2:
		rooms += 1
print(rooms)


n = int(input())
Res = 0
for i in range(n):
	l = [int(k) for k in input().split(' ')]
	(p, q) = (l[0], l[1])
	if q - p > 1:
		Res += 1
print(str(Res))


a = int(input())
s = 0
for item in range(a):
	(b, c) = input().split()
	b = int(b)
	c = int(c)
	if c - b >= 2:
		s += 1
	else:
		s = s
print(s)


n = int(input())
c = 0
for i in range(n):
	l = []
	l = list(map(int, input().split()))
	if l[1] - l[0] >= 2:
		c += 1
	else:
		pass
print(c)


rooms = int(input())
free_rooms = 0
while rooms > 0:
	(living, capacity) = map(int, input().split())
	if living <= capacity - 2:
		free_rooms += 1
	rooms -= 1
print(free_rooms)


n = int(input())
ans = 0
for _ in range(n):
	(a, b) = map(int, input().split())
	diff = abs(a - b)
	if diff >= 2:
		ans += 1
print(ans)


count = int(input())
rooms = [[int(x) for x in input().split()] for _ in range(count)]
print(len([0 for (p, q) in rooms if q - p >= 2]))


a = int(input())
b = []
count = 0
for i in range(a):
	b.append(input().split())
	for j in range(2):
		b[i][j] = int(b[i][j])
	if b[i][1] - b[i][0] >= 2:
		count += 1
print(count)


n = int(input())
n_options = 0
for j in range(n):
	(curr_occ, max_occ) = (int(x) for x in input().split())
	if max_occ - curr_occ >= 2:
		n_options += 1
print(n_options)


n = int(input())
a = []
for i in range(n):
	a.append(list(map(int, input().split())))
ans = 0
for temp in a:
	ans += temp[1] - temp[0] >= 2
print(ans)


c = 0
n = int(input())
for i in range(n):
	(a, b) = [int(x) for x in input().split()]
	if b - a > 1:
		c += 1
print(c)


num = int(input())
count = 0
for i in range(0, num):
	(a, b) = map(int, input().split())
	if b - a > 2 or b - a == 2:
		count = count + 1
print(count)


n = int(input())
can = 0
for i in range(n):
	(pi, qi) = map(int, input().split())
	num = qi - pi
	if num >= 2:
		can += 1
print(can)


n = int(input())
otvet = 0
for i in range(n):
	vvod = input().split(' ')
	if int(vvod[1]) - int(vvod[0]) >= 2:
		otvet += 1
print(otvet)


n = int(input())
c = 0
for i in range(n):
	s = input()
	p = int(s[:s.find(' ')])
	q = int(s[s.find(' '):])
	if q - p >= 2:
		c = c + 1
print(c)


noOfRooms = int(input())
people_capacity = [list(map(int, input().split(' '))) for i in range(noOfRooms)]
print(len([i for i in people_capacity if i[1] - i[0] >= 2]))


n = input()
count = int(0)
for x in range(int(n)):
	temp = [int(y) for y in input().split()]
	if temp[1] - temp[0] > int(1):
		count += 1
print(count)


n = int(input())
a = []
q = 0
for i in range(n):
	a.append([int(x) for x in input().split()])
for m in range(n):
	d = a[m][1] - a[m][0]
	if d >= 2:
		q += 1
print(q)


n = int(input())
r = []
for i in range(n):
	p = input().split(' ')
	r += [(int(p[0]), int(p[1]))]
print(len([x for x in r if x[1] - x[0] >= 2]))


n = int(input())
cnt = 0
for i in range(0, n):
	li = input().split()
	if int(li[1]) - int(li[0]) >= 2:
		cnt += 1
print(cnt)


n = int(input())
nCount = 0
for i in range(n):
	(pi, qi) = map(int, input().split())
	if qi - pi >= 2:
		nCount += 1
print(nCount)


n = int(input())
cnt = 0
for i in range(0, n):
	(am, cp) = [int(x) for x in input().split()]
	if cp - am >= 2:
		cnt += 1
print(cnt)


n = int(input())
count = 0
i = 0
while i < n:
	x = input().split()
	c = int(x[1]) - int(x[0])
	if c >= 2:
		count += 1
	i += 1
print(count)


a = input()
a = int(a)
b = []
for i in range(a):
	b.append(input().split(' '))
licznik = 0
for i in b:
	c = int(i[1]) - int(i[0])
	if c > 1:
		licznik = licznik + 1
print(licznik)


import sys
firstLine = True
total = 0
for line in sys.stdin:
	if firstLine:
		numlines = int(line)
		firstLine = False
		continue
	line = line[:len(line) - 1]
	(p, q) = line.split(' ')
	if int(q) - int(p) >= 2:
		total += 1
	numlines -= 1
	if numlines == 0:
		break
print(total)


rooms = int(input())
roomsAvailable = 0
roomNumber = 1
for x in range(rooms):
	(a, b) = input().split()
	roomNumber += 1
	if int(b) - int(a) >= 2:
		roomsAvailable += 1
print(roomsAvailable)


x = int(input())
c = 0
for i in range(x):
	(p, q) = tuple(map(int, input().split(' ')))
	if q - p >= 2:
		c += 1
print(c)


n = int(input())
l = []
for _ in range(n):
	A = input()
	a = int(A.split()[0])
	b = int(A.split()[1])
	l.append(a)
	l.append(b)
c = 0
j = 0
while j < 2 * n - 1:
	if l[j + 1] - l[j] >= 2:
		c += 1
	j += 2
print(c)


(n, result) = (int(input()), 0)
for i in range(n):
	(busy, overall) = map(int, input().split())
	if busy + 2 <= overall:
		result += 1
print(result)


n = int(input())
counter = 0
for i in range(n):
	rooms = [int(x) for x in input().split(' ')]
	diff = abs(rooms[0] - rooms[1])
	if diff >= 2:
		counter += 1
print(counter)


aantal = int(input())
lijst = []
kamers = 0
for i in range(0, aantal):
	lijst.append(list(map(int, input().split(' '))))
for j in range(0, aantal):
	if lijst[j][1] - lijst[j][0] >= 2:
		kamers += 1
print(kamers)


result = 0
for _ in range(int(input())):
	(people, capacity) = map(int, input().split())
	if capacity - people >= 2:
		result += 1
print(result)


a = int(input())
print(sum((eval(input().replace(' ', '-')) < -1 for i in range(a))))


n = int(input())
f = 0
for i in range(0, n):
	(p, q) = input().split()
	np = int(p)
	nq = int(q)
	if np + 2 <= nq:
		f += 1
print(f)


n = int(input())
print(sum((eval(input().replace(' ', '-')) < -1 for _ in range(n))))


N = int(input(''))
Cont = 0
for K in range(N):
	Dat = input('')
	Dat = Dat.split()
	PV = int(Dat[0])
	Cap = int(Dat[1])
	if Cap - PV > 1:
		Cont = Cont + 1
print(Cont)


n = int(input())
c = []
for i in range(n):
	(x1, x2) = map(int, input().split())
	c.append((x1, x2))
n = 0
for el in c:
	if el[0] + 2 <= el[1]:
		n += 1
print(n)


n = int(input())
number = [list(map(int, input().split())) for i in range(n)]
count = 0
for i in number:
	count += 1 if abs(i[1] - i[0]) >= 2 else 0
print(count)


n = int(input())
out = 0
for i in range(n):
	inp = input().split(' ')
	if int(inp[1]) - int(inp[0]) >= 2:
		out += 1
print(out)


n = int(input())
(p, q, l) = ([], [], 0)
for _ in range(n):
	a = list(map(int, input().split()))
	p.append(a[0])
	q.append(a[1])
for i in range(n):
	if q[i] - p[i] >= 2:
		l = l + 1
print(l)


from sys import stdin
r = [x.rstrip() for x in stdin.readlines()][1:]
print(sum((int(x.split()[1]) - int(x.split()[0]) >= 2 for x in r)))


N = int(input())
rooms = 0
result = 0
for i in range(N):
	data = list(input().split(' '))
	if int(data[1]) - int(data[0]) >= 2:
		rooms += 1
print(rooms)


c = 0
for t in range(int(input())):
	(p, k) = map(int, input().split(' '))
	if k - p >= 2:
		c = c + 1
print(c)


n = int(input())
l = []
h = []
g = []
for i in range(n):
	k = list(map(int, input().split()))
	l.append(k[0])
	h.append(k[1])
for i in range(n):
	g.append(h[i] - l[i])
c = 0
for i in g:
	if i >= 2:
		c = c + 1
print(c)


tC = int(input())
inp = []
count = 0
for x in range(tC):
	temp = list(map(int, input().split()))
	inp.append(temp)
	if inp[x][0] <= inp[x][1] - 2:
		count += 1
print(count)


q = int(input())
ans = 0
for _ in range(q):
	s = [int(i) for i in input().split(' ')]
	if s[1] - s[0] >= 2:
		ans += 1
print(ans)


a = int(input())
t = 0
for i in range(a):
	s = input().split()
	if int(s[1]) - int(s[0]) >= 2:
		t = t + 1
print(t)


try:
	t = int(input())
	count = 0
	for i in range(t):
		(a, b) = map(int, input().split())
		if b - a >= 2:
			count += 1
	print(count)
except:
	pass


c = 0
for t in range(int(input())):
	(n, m) = map(int, input().split())
	if m >= n + 2:
		c += 1
print(c)


n = int(input())
rcount = 0
for i in range(n):
	room = [int(n) for n in input().split()]
	if abs(room[0] - room[1]) >= 2:
		rcount += 1
print(rcount)


n = int(input())
count = 0
for _ in range(n):
	(p, q) = map(int, input().split())
	if p == q or p + 1 == q:
		count += 0
	else:
		count += 1
print(count)


def main():
	num = int(input())
	answer = 0
	for i in range(0, num):
		pq = input().split(' ')
		for i in range(0, len(pq)):
			pq[i] = int(pq[i])
		if pq[1] - pq[0] >= 2:
			answer += 1
	print(answer)
main()


huy = int(input())
i = 0
arr = []
while i < huy:
	a = input()
	b = a.split(' ')
	c = int(b[1]) - int(b[0])
	arr.append(c)
	i += 1
a = 0
d = 0
leng = len(arr)
while a < leng:
	if arr[a] < 2:
		pass
	if arr[a] >= 2:
		d += 1
	a += 1
print(d)


n = int(input())
bulk0 = []
ncount = 0
for i in range(n):
	bulk0 = [int(x) for x in input().split()]
	if bulk0[1] - 2 >= bulk0[0]:
		ncount += 1
print(ncount)


t = int(input())
l = []
c = 0
for i in range(t):
	(p, q) = input().split()
	l.append(int(p))
	l.append(int(q))
for j in range(0, t * 2, 2):
	if l[j + 1] - l[j] >= 2:
		c = c + 1
print(c)


n = int(input())
quant = 0
for i in range(n):
	room = [int(num) for num in input().split()]
	if room[1] - room[0] >= 2:
		quant += 1
	else:
		continue
print(quant)


n = int(input())
d = []
for i in range(n):
	c = list(map(int, input().split()))
	if c[1] - c[0] >= 2:
		d.append(c[1] - c[0])
print(len(d))


l = []
for _ in range(int(input())):
	l.append(list(map(int, input().split())))
count = 0
for i in range(0, len(l)):
	for j in range(0, len(l[i]) - 1):
		if l[i][j + 1] - l[i][j] >= 2:
			count = count + 1
		else:
			count = count
print(count)


rooms = int(input())
accomodation = 0
for i in range(rooms):
	memberCapacity = input()
	memberCapacity = memberCapacity.rsplit(' ')
	freeSeats = int(memberCapacity[1]) - int(memberCapacity[0])
	if freeSeats > 1:
		accomodation = accomodation + 1
print(accomodation)


n = int(input())
t = 0
for i in range(n):
	(x, y) = [int(i) for i in input().split()]
	if y - x > 1:
		t += 1
print(t)


n = int(input())
i = 1
output = 0
while i <= n:
	(pi, qi) = (int(x) for x in input().split())
	if qi - pi >= 2:
		output += 1
	i += 1
print(output)


n = int(input())
t = []
for i in range(n):
	t.append(input().split())
c = 0
for i in t:
	if int(i[1]) - int(i[0]) > 1:
		c += 1
print(c)


count = 0
for i in range(int(input())):
	(Pi, Qi) = map(int, input().split())
	if Pi < Qi:
		if Qi - Pi == 1:
			continue
		else:
			count = count + 1
	else:
		continue
print(count)


p = 0
for i in [0] * int(input()):
	l = 0
	l = l - eval('-'.join(input().split()))
	if l >= 2:
		p += 1
print(p)


def main():
	count = 0
	lim = int(input())
	for x in range(lim):
		(p, q) = list(map(int, input().split()))
		if q - p >= 2:
			count += 1
	print(count)
main()


a = int(input())
k = 0
for x in range(1, a + 1):
	if eval(input().replace(' ', '-')) < -1:
		k += 1
print(k)


rooms = int(input())
avail = 0
for i in range(0, rooms):
	(a, b) = map(int, input().split())
	if b - a >= 2:
		avail += 1
print(avail)


c = 0
for i in range(int(input())):
	(x, y) = map(int, input().split())
	if y - x >= 2:
		c += 1
print(c, end='')


n = int(input())
ans = 0
while n > 0:
	s = [int(x) for x in input().strip().split()]
	free = s[1] - s[0]
	if free >= 2:
		ans += 1
	n = n - 1
print(ans)


n = int(input())
count = 0
for i in range(0, n):
	s = str(input())
	s = s.split(' ')
	p = int(s[0])
	q = int(s[1])
	if q - p >= 2:
		count += 1
print(count)


def Main():
	c = 0
	n = int(input())
	while n >= 1:
		x = input().split()
		if int(x[1]) - int(x[0]) > 1:
			c += 1
		n -= 1
	print(c)
Main()


x = int(input())
k = 0
for i in range(x):
	(s, t) = list(map(int, input().split()))
	if t - s >= 2:
		k += 1
print(k)


n = int(input())
rooms = 0
for x in range(n):
	(p, q) = map(int, input().split())
	if q - p >= 2:
		rooms = rooms + 1
print(rooms)


n = int(input())
cnt = 0
for i in range(n):
	(a, b) = list(map(int, input().split()))
	if b - a > 1:
		cnt += 1
print(cnt)


n = int(input())
count = 0
while n > 0:
	data = [int(x) for x in input().split()]
	count += 1 if data[1] - data[0] > 1 else 0
	n -= 1
print(count)


n = int(input())
roomsAvailable = 0
for i in range(n):
	(p, q) = input().split()
	p = int(p)
	q = int(q)
	if q - p >= 2:
		roomsAvailable += 1
print('%d' % roomsAvailable)


q = []
p = []
n = int(input())
for i in range(n):
	a = input()
	a = a.split()
	q.append(a[0])
	p.append(a[1])

def chck(p, q, n):
	inc = 0
	for i in range(n):
		if int(q[i]) <= int(p[i]) - 2:
			inc += 1
	return inc
print(chck(p, q, n))


n = int(input())
cont = 0
for k in range(0, n):
	a = input().split()
	if int(a[1]) - int(a[0]) > 1:
		cont += 1
print(cont)


n = int(input())
(lp, lq) = ([], [])
for i in range(n):
	(p, q) = input().split()
	lp.append(int(p))
	lq.append(int(q))
free_rooms = 0
for y in range(len(lq)):
	if lq[y] - lp[y] >= 2:
		free_rooms += 1
print(free_rooms)


n = int(input())
count = 0
room = []
for i in range(0, n):
	p = list(map(int, input().strip().split()))
	room.append(p)
for j in range(0, len(room)):
	d = 0
	d = room[j][1] - room[j][0]
	if d > 1:
		count = count + 1
	else:
		pass
print(count)


n = int(input())
ans = 0
for i in range(0, n):
	(a, b) = map(int, input().split())
	ans += b - a >= 2
print(ans)


k = int(input())
l = 0
m = 0
for x in range(k):
	f = input()
	f = f.split()
	f[0] = int(f[0])
	f[1] = int(f[1])
	if f[1] - f[0] >= 2:
		l += 1
print(l)


a = int(input())
b = []
c = 0
for x in range(a):
	b.append(list(map(int, input().split())))
for y in range(a):
	if b[y][1] - b[y][0] > 1:
		c += 1
print(c)


a = list()
count = 0
for _ in range(int(input())):
	(x, y) = map(int, input().split())
	a.append(y - x)
for i in a:
	if i >= 2:
		count += 1
print(count)


a = int(input())
i = 0
total = 0
while i < a:
	b = input().split(' ')
	if int(b[0]) + 2 <= int(b[1]):
		total += 1
	i += 1
print(total)


n = int(input())
rez = 0
for i in range(n):
	(a, b) = list(map(int, input().split()))
	if b - a >= 2:
		rez += 1
print(rez)


n = int(input())
count = 0
for _ in range(n):
	(a, b) = input().split()
	(a, b) = (int(a), int(b))
	if b - a > 1:
		count += 1
print(count)


n = int(input(''))
count = 0
for k in range(0, n):
	(a, b) = input('').split(' ')
	p = int(a)
	q = int(b)
	if q - p >= 2:
		count = count + 1
	else:
		count = count
print(count)


n = int(input())
m = 0
t = 0
while m < n:
	s = list(map(int, input().split()))
	if s[1] - s[0] >= 2:
		t += 1
	else:
		t = t
	m += 1
print(t)


n = int(input())
rooms = []
for i in range(n):
	lst = input().split()
	lst[0] = int(lst[0])
	lst[1] = int(lst[1])
	rooms.append(lst)
cnt = 0
for i in rooms:
	if i[1] - i[0] >= 2:
		cnt += 1
print(cnt)


t = int(input())
i = 0
c = 0
while i < t:
	(a, b) = map(int, input().split(' '))
	d = b - a
	if d >= 2:
		c = c + 1
	i = i + 1
print(c)


res = 0
for _ in range(int(input())):
	(p, q) = [int(i) for i in input().split()]
	if q - p > 1:
		res += 1
print(res)


import sys
data = sys.stdin.readlines()
point = 0
final_data = data[1:]
for item in final_data:
	temporary = item.strip().split(' ')
	if abs(int(temporary[0]) - int(temporary[1])) >= 2:
		point += 1
print(point)


n = int(input())
mang = [[int(s) for s in input().split()] for j in range(n)]
kq = 0
for i in range(n):
	if mang[i][1] - mang[i][0] >= 2:
		kq += 1
print(kq)


number_of_rooms = int(input())
B = 0
for i in range(0, number_of_rooms):
	x = input()
	(p, q) = x.split(' ')
	if int(q) - int(p) >= 2:
		B = B + 1
print(B)


n = int(input())
w = []
er = []
we = []
for i in range(n):
	(p, q) = [int(n) for n in input().split()]
	w.append([p, q])
for i in w:
	er.append(i[1] - i[0])
for j in er:
	if j >= 2:
		we.append(1)
	else:
		None
print(sum(we))


n = int(input())
number = 0
for i in range(n):
	pq = input().split(' ')
	p = int(pq[0])
	q = int(pq[1])
	if q - p >= 2:
		number += 1
print(number)


n = int(input())
count = 0
for x in range(n):
	(r, k) = list(map(int, input().split()))
	f = k - r
	if f >= 2:
		count += 1
	else:
		count += 0
print(count)


a = []
b = []
k = 0
while True:
	try:
		a.append(input())
	except:
		break
n = int(a[0])
for i in range(1, n + 1):
	b = a[i].split(' ')
	if abs(int(b[0]) - int(b[len(b) - 1])) >= 2:
		k += 1
print(k)


print(sum(((lambda x: x[0] + 2 <= x[1])(list(map(int, input().split()))) for x in range(int(input())))))


rooms = int(input())
c = 0
for i in range(rooms):
	l = list(input().split(' '))
	p = int(l[0])
	q = int(l[1])
	if q - p >= 2:
		c += 1
print(c)


n = int(input())
somme = 0
for i in range(n):
	(p, max) = map(int, input().split())
	if p + 2 <= max:
		somme += 1
print(somme)


def solve(pqs):
	return sum((p + 2 <= q for (p, q) in pqs))

def main():
	n = int(input())
	pqs = [tuple((int(i) for i in input().split())) for _ in range(n)]
	result = solve(pqs)
	print(result)
main()


Cnt = 0
N = int(input())
for wi in range(1, N + 1):
	In = input().split(' ')
	if int(In[1]) - int(In[0]) >= 2:
		Cnt = Cnt + 1
print('%d' % Cnt)


tc = int(input())
count = 0
for i in range(tc):
	(a, b) = list(map(int, input().split()))
	if b - a >= 2:
		count = count + 1
print(count)


n = int(input())
l = list()
tmpl = list()
for i in range(n):
	(in1, in2) = map(int, input().split(' '))
	l.append([in1, in2])
i = 0
for tmpl in l:
	if tmpl[1] - tmpl[0] > 1:
		i += 1
print(i)


n = int(input())
mas = []
p = []
q = []
c = 0
for i in range(0, n):
	mas = input().split(' ')
	a1 = int(mas[0])
	a2 = int(mas[1])
	p.insert(i, a1)
	q.insert(i, a2)
for j in range(0, n):
	if p[j] + 2 <= q[j]:
		c += 1
print(c)


n = int(input())
L = []
count = 0
for i in range(n):
	L.append(input().split())
	L[i] = list(map(int, L[i]))
for row in L:
	if row[1] - row[0] >= 2:
		count += 1
	else:
		pass
print(count)


n = int(input())
res = 0
for _ in range(n):
	(a, b) = [int(i) for i in input().split()]
	if b - a >= 2:
		res += 1
print(res)


n = int(input())
arr_p = []
arr_q = []
count = 0
for i in range(n):
	(p, q) = map(int, input().split())
	arr_p.append(p)
	arr_q.append(q)
for i in range(n):
	if arr_q[i] - arr_p[i] >= 2:
		count += 1
print(count)


number = input()
output = 0
for x in range(int(number)):
	(a, b) = map(int, input().split())
	if a + 2 <= b:
		output += 1
print(output)


n = int(input())
counter = 0
for rooms in range(n):
	(p, q) = list(map(int, input().split()))
	if q - p >= 2:
		counter += 1
print(counter)


def translation():
	word_1 = input()
	word_2 = input()[::-1]
	print(['NO', 'YES'][word_1 == word_2])
	return

def anton_and_danik():
	games = int(input())
	wins = input()
	anton_wins = sum((i == 'A' for i in wins))
	if anton_wins * 2 > len(wins):
		print('Anton')
	elif anton_wins * 2 == len(wins):
		print('Friendship')
	else:
		print('Danik')
	return

def acoomodation():
	cnt = 0
	for _ in range(int(input())):
		(p, q) = map(int, input().split())
		if q - p >= 2:
			cnt += 1
	print(cnt)
	return
acoomodation()


a = int(input())
z = []
c = 0
for i in range(a):
	b = list((int(x) for x in input().split(' ')))
	if b[0] <= b[1] - 2:
		c += 1
print(c)


n = int(input())
q = 0
for i in range(n):
	w = tuple(map(int, input().split()))
	if w[0] + 2 <= w[1]:
		q += 1
print(q)


t = int(input())
ans = 0
i = 0
while i < t:
	k = input()
	f = k.split(' ')
	if int(f[1]) - int(f[0]) >= 2:
		ans += 1
	i += 1
print(ans)


try:
	t = int(input())
	ans = 0
	for _ in range(t):
		(a, b) = map(int, input().split())
		if b - a >= 2:
			ans += 1
	print(ans)
except:
	pass


room = int(input())
able = 0
for i in range(room):
	(rM, spaceF) = map(int, input().split())
	if rM + 2 <= spaceF:
		able += 1
print(able)


def count_empty_room(pi, qi):
	if qi - pi >= 2:
		return 1
	return 0

def main():
	rooms = int(input())
	empty_rooms = 0
	for i in range(rooms):
		(pi, qi) = map(int, input().split())
		empty_rooms += count_empty_room(pi, qi)
	print(empty_rooms)
main()


n = int(input(''))
count = 0
for i in range(n):
	(f, l) = map(int, input('').split(' '))
	if l - f >= 2:
		count = count + 1
print(count)


t = int(input())
c = 0
for i in range(t):
	(q, p) = [int(x) for x in input().split()]
	if p - q > 1:
		c += 1
print(c)


a = [map(int, input().split()) for x in range(int(input()))]
res = 0
for i in a:
	t = list(i)
	if t[1] - t[0] > 1:
		res += 1
print(res)


N = int(input())
C = 0
for i in range(N):
	(p, q) = map(int, input().split())
	if q - p < 2:
		continue
	else:
		C += 1
print(C)


a = int(input())
n = 0
for i in range(a):
	s = input().split()
	if int(s[0]) + 2 <= int(s[1]):
		n += 1
	else:
		continue
print(n)


i = input
print(sum([-eval(i().replace(' ', '-')) > 1 for n in 'a' * int(i())]))


room = input()
room = int(room)
i = room
j = 0
count = 0
lin = []
while room > 0:
	da = [int(x) for x in input().split()]
	lin.append(da)
	room = room - 1
while j < i:
	da = lin[j]
	pep = da[0]
	cap = da[1]
	free = cap - pep
	if free >= 2:
		count = count + 1
	j = j + 1
print(count)


n = int(input())
total = 0
for i in range(n):
	(a, b) = [int(z) for z in input().split()]
	if b - a >= 2:
		total += 1
print(total)


aa = input()
a = int(aa)
sum = 0
n = 0
while n < a:
	bb = input()
	b = bb.split()
	i = int(b[0])
	j = int(b[1])
	res = j - i
	if res > 1:
		sum = sum + 1
	n = n + 1
print(sum)


x = int(input())
ctr = 0
a = []
b = []
for i in range(0, x):
	(y, z) = [int(i) for i in input().split(' ')]
	a.append(int(y))
	b.append(int(z))
for k in range(0, len(a)):
	first = a[k]
	second = b[k]
	if first + 2 <= second:
		ctr += 1
print(ctr)


n = int(input())
dorm = []
for i in range(n):
	(live, capacity) = map(int, input().split())
	dorm.append([live, capacity])
temp = 0
for i in range(n):
	if int(dorm[i][1]) - int(dorm[i][0]) >= 2:
		temp += 1
print(temp)


rooms = 0
for i in range(int(input())):
	(a, b) = (int(q) for q in input().split())
	if b - a >= 2:
		rooms += 1
print(rooms)


s = int(input())
cnt = 0
for i in range(s):
	l = list(map(int, input().split()))
	(p, q) = (l[0], l[1])
	if q - p >= 2:
		cnt += 1
print(cnt)


n = int(input())
emptyroom = 0
for i in range(n):
	aroom = list(map(int, input().split()))
	roombed = aroom[1] - aroom[0]
	if roombed >= 2:
		emptyroom = emptyroom + 1
print(emptyroom)


n = int(input())
counter_room = 0
for room in range(n):
	room = list(map(int, input().split()))
	if room[0] + 2 <= room[1]:
		counter_room += 1
print(counter_room)


s = int(input())
dem = 0
while s:
	(x, y) = map(int, input().split())
	if y - x >= 2:
		dem += 1
	s -= 1
print(dem)


lines = []
while True:
	try:
		lines.append(input())
	except EOFError:
		break
count_rooms = 0
for u in range(1, int(lines[0]) + 1):
	tempo = lines[u].split()
	avail_capacity = int(tempo[1]) - int(tempo[0])
	if avail_capacity >= 2:
		count_rooms = count_rooms + 1
	else:
		continue
print(count_rooms)


n = int(input())
count = 0
for _ in range(n):
	(p, q) = map(int, input().split())
	if p != q and p + 2 <= q:
		count += 1
	else:
		pass
print(count)


n = int(input())
k = 0
for i in range(n):
	(x, y) = [int(x) for x in input().split()]
	if y - x >= 2:
		k += 1
print(k)


n = int(input())
m = list()
for i in range(n):
	m.append(list((int(x) for x in input().split())))
c = 0
for i in range(n):
	if m[i][0] + 2 <= m[i][1]:
		c += 1
print(c)


number = int(input())
ok = 0
for i in range(number):
	(m, c) = map(int, input().split())
	if c - m >= 2:
		ok += 1
print(ok)


n = int(input())
k = 0
for i in range(n):
	(p, q) = map(int, input().strip().split(' '))
	if q - p >= 2:
		k += 1
print(k)


n = int(input())
c = 0
while n:
	rooms = input().split()
	living = int(rooms[0])
	capacity = int(rooms[1])
	if capacity - living >= 2:
		c += 1
	n -= 1
print(c)


x = int(input())
count = 0
for i in range(0, x):
	(y, z) = input().split()
	if int(y) + 1 < int(z):
		count += 1
print(count)


import sys
n = int(input())
count = 0
for i in range(0, n):
	sa = sys.stdin.readline()
	list = sa.split()
	n = int(list[0])
	m = int(list[1])
	if n + 2 <= m:
		count += 1
print(count)


n = int(input())
cnt = 0
for _ in range(n):
	(o, t) = [int(x) for x in input().split()]
	if t - o >= 2:
		cnt += 1
print(cnt)


numOfRoom = input()
people = []
space = []
count = 0
for i in range(int(numOfRoom)):
	ip = input().split(' ')
	if int(ip[1]) - int(ip[0]) >= 2:
		count += 1
print(count)


def even(n):
	counter = 0
	for i in range(n):
		x = list(map(int, input().split()))
		if abs(x[0] - x[1]) >= 2:
			counter += 1
	print(counter)
n = int(input())
even(n)


n = int(input())
counter = 0
for i in range(n):
	(f, c) = [int(j) for j in input().split()]
	if c - f >= 2:
		counter += 1
print(counter)


n = int(input())
counter = 0
while n >= 1:
	x = input().split()
	if int(x[1]) - int(x[0]) > 1:
		counter += 1
	n -= 1
print(counter)


class Room:

	def __init__(self, currentPopu, availablePopu):
		self.currentPopu = currentPopu
		self.availablePopu = availablePopu
n = int(input())
count = 0
for i in range(0, n):
	(p, q) = map(int, input().split())
	newRoom = Room(p, q)
	if newRoom.availablePopu - newRoom.currentPopu >= 2:
		count += 1
print(count)


total = int(input())
avaliable = 0
for i in range(total):
	(p, q) = map(int, input().split())
	if q - p >= 2:
		avaliable += 1
	else:
		pass
print(avaliable)


def accom():
	n = int(input())
	counter = 0
	for i in range(n):
		(x, y) = input().split()
		cap = int(y) - int(x)
		if cap > 1:
			counter += 1
	print(counter)
accom()


C = 0
for i in range(int(input())):
	(X, Y) = map(int, input().split())
	if Y - X >= 2:
		C += 1
print(C)


counter = 0
for x in range(int(input())):
	(people, capacity) = [int(y) for y in input().split()]
	if capacity - people >= 2:
		counter += 1
print(counter)


n = int(input())
s = 0
for i in range(n):
	p = input().split()
	x = int(p[0])
	y = int(p[1])
	if y - x > 1:
		s += 1
print(s)


n = int(input())
room = []
for i in range(n):
	room.append([int(x) for x in input().split()])
count = 0
for i in room:
	if i[1] - i[0] >= 2:
		count += 1
print(count)


n = int(input())
i = 1
ans = 0
while i <= n:
	(p, q) = [int(i) for i in input().split()]
	if q - p >= 2:
		ans += 1
	i += 1
print(ans)


n = int(input())
r = 0
for _ in range(n):
	(a, b) = [int(x) for x in input().split()]
	if b - a >= 2:
		r += 1
print(r)


n = int(input())
c = 0
for i in range(n):
	(xi, yi) = [int(i) for i in input().split()]
	if yi - xi >= 2:
		c += 1
print(c)


print(sum((eval(input().replace(' ', '-')) <= -2 for i in range(int(input())))))


n = int(input())
rooms = []
for _ in range(n):
	rooms.append([int(a) for a in input().split(' ')])
count = 0
for room in rooms:
	if room[1] - room[0] >= 2:
		count += 1
print(count)


n = int(input())
k = int(0)
for i in range(n):
	a = input()
	r = a.find(' ')
	s = int(a[:r])
	d = int(a[r + 1:])
	if d - s > 1:
		k += 1
print(k)


v = 0
for _ in range(int(input())):
	(a, c) = (int(x) for x in input().split())
	if c - a >= 2:
		v += 1
print(v)


def georgeAndAccomodation():
	count = 0
	n = int(input())
	for i in range(n):
		values = input().split()
		if int(values[1]) - int(values[0]) >= 2:
			count += 1
	print(count)
georgeAndAccomodation()


n = int(input())
count = 0
for _ in range(n):
	(p, q) = [int(e) for e in input().split()]
	if q - p >= 2:
		count += 1
print(count)


n = int(input())
count = 0
for i in range(n):
	(free, total) = map(int, input().split())
	if total - free >= 2:
		count += 1
print(count)


n = int(input())
k = 0
for i in range(n):
	(s1, s2) = map(int, input().split())
	if s1 + 2 <= s2:
		k += 1
print(k)


tc = int(input())
c = 0
for t in range(tc):
	(n, q) = [int(i) for i in input().split(' ')]
	if n == q:
		continue
	elif n + 2 <= q:
		c += 1
print(c)


n = int(input())
t = 0
for case in range(n):
	data = [int(x) for x in input().split()]
	if data[1] - data[0] >= 2:
		t += 1
print(t)


rooms = 0
for _ in range(int(input())):
	(a, b) = map(int, input().split())
	rooms += 1 if b - a >= 2 else 0
print(rooms)


room = int(input())
c = 0
for i in range(room):
	(no, cap) = input().split()
	x = int(cap) - int(no)
	if x >= 2:
		c += 1
print(c)


n = eval(input())
c = 0
for i in range(n):
	(n, m) = map(int, input().split(' '))
	if m > n and m - n > 1:
		c = c + 1
print(c)


class Room:

	def __init__(self, p, q):
		self.p = p
		self.q = q
n = int(input())
rooms = []
for i in range(n):
	(p, q) = map(int, input().split())
	rooms.append(Room(p, q))
print(len([1 for room in rooms if room.q - room.p >= 2]))


s = int(input())
l = []
flag = 0
for x in range(s):
	l.append(input().strip().split()[:2])
for x in range(s):
	if int(l[x][1]) - int(l[x][0]) >= 2:
		flag += 1
print(flag)


c = 0
for i in range(int(input())):
	a = list((int(x) for x in input().split()))
	da = a[1] - a[0]
	if da >= 2:
		c += 1
	else:
		pass
print(c)


def r(p, q):
	if q - p >= 2:
		return True
	else:
		return False
n = int(input())
c = 0
for _ in range(n):
	(p, q) = map(int, input().split())
	if r(p, q):
		c += 1
print(c)


num = int(input())
count = 0
for i in range(num):
	l = input().split()
	if int(l[1]) - int(l[0]) >= 2:
		count += 1
	else:
		count += 0
print(count)


n = int(input())
mainList = list()

def process(mainList):
	counter = 0
	for i in mainList:
		if i[1] - i[0] >= 2:
			counter += 1
	print(counter)
while n > 0:
	f = [int(x) for x in input().split()]
	mainList.append(f)
	n -= 1
process(mainList)


t = int(input())
c = 0
for _ in range(t):
	l = list(map(int, input().split()))
	if l[1] - l[0] >= 2:
		c += 1
print(c)


n = int(input())
p = []
q = []
p_q = []
for i in range(n):
	x = input()
	y = x.split()
	z = [int(d) for d in y]
	p.append(z[0])
	q.append(z[1])
	p_q.append(q[i] - p[i])
count_0 = p_q.count(0)
count_1 = p_q.count(1)
print(n - count_0 - count_1)


n = int(input())
co = 0
for i in range(n):
	l = list(map(int, input().split()))
	if l[1] - l[0] > 1:
		co += 1
print(co)


limit = int(input())
rooms = []
count = 0
for i in range(limit):
	rooms.append(input())
for room in rooms:
	room_array = room.split(' ')
	p = int(room_array[0])
	q = int(room_array[1])
	diff = q - p
	if diff >= 2:
		count += 1
print(count)


a = int(input())
k = 0
for i in range(a):
	m = [int(x) for x in input().split()]
	if m[1] - m[0] >= 2:
		k += 1
print(k)


a = int(input())
output = 0
for i in range(a):
	(x, y) = input().split()
	if int(y) - int(x) >= 2:
		output += 1
print(output)


n = int(input())
c = 0
for i in range(n):
	l = list((int(x) for x in input().strip().split()))[:2]
	if l[1] - l[0] >= 2:
		c += 1
print(c)


t = 0
for i in range(int(input())):
	(l, r) = list(map(int, input().split()))
	if r - l >= 2:
		t += 1
print(t)


s = int(input())
s1 = []
counter = 0
for i in range(s):
	s1.append(input().split())
for i in range(len(s1)):
	if int(s1[i][0]) < int(s1[i][1]) and int(s1[i][1]) - int(s1[i][0]) >= 2:
		counter += 1
print(counter)


ans = 0
for i in range(int(input())):
	(a, b) = [int(i) for i in input().split()]
	ans += b - a > 1
print(ans)


x = int(input())
r = 0
for n in range(x):
	(a, b) = map(int, input().strip().split())
	if b - a >= 2:
		r = r + 1
print(r)


n = int(input())
mem = [-1] * n
cap = [-1] * n
ans = 0
for i in range(n):
	(mem[i], cap[i]) = map(int, input().split())
	if cap[i] - mem[i] >= 2:
		ans += 1
print(ans)


n = int(input())
v = 0
for i in range(n):
	z = input().split()
	if int(z[0]) + 2 <= int(z[1]):
		v += 1
print(v)


n = int(input())
t = 0
for i in range(n):
	(p, q) = [int(x) for x in input().split()]
	if p <= q and q - p >= 2:
		t += 1
print(t)


num = int(input())
count = 0
for i in range(num):
	line = input()
	(m, n) = [int(j) for j in line.split()]
	if n - m >= 2:
		count += 1
print(count)


n = int(input())
k = 0
for i in range(n):
	list1 = input().split()
	r = int(list1[1]) - int(list1[0])
	if r >= 2:
		k += 1
print(k)


n = int(input())
c = 0
for i in range(n):
	(p, q) = [int(p) for p in input().split()]
	if p == q:
		c += 0
	elif p < q:
		if q - p >= 2:
			c += 1
		else:
			c += 0
print(c)


q = int(input())
s = 0
for i in range(q):
	(z, x) = map(int, input().split())
	if x - z > 1:
		s += 1
print(s)


n = int(input())
ans = 0
for i in range(0, n):
	str = input().split()
	if int(str[1]) - int(str[0]) >= 2:
		ans += 1
print(ans)


c = 0
for i in range(int(input())):
	(k, l) = map(int, input().split(' '))
	if l - k >= 2:
		c = c + 1
print(c)


(z, zz) = (input, lambda : list(map(int, z().split())))
zzz = lambda : [int(i) for i in stdin.readline().split()]
(szz, graph, mod, szzz) = (lambda : sorted(zz()), {}, 10 ** 9 + 7, lambda : sorted(zzz()))
from string import *
from re import *
from collections import *
from queue import *
from sys import *
from collections import *
from math import *
from heapq import *
from itertools import *
from bisect import *
from collections import Counter as cc
from math import factorial as f
from bisect import bisect as bs
from bisect import bisect_left as bsl
from itertools import accumulate as ac

def lcd(xnum1, xnum2):
	return xnum1 * xnum2 // gcd(xnum1, xnum2)

def prime(x):
	p = ceil(x ** 0.5) + 1
	for i in range(2, p):
		if x % i == 0 and x != 2 or x == 0:
			return 0
	return 1

def dfs(u, visit, graph):
	visit[u] = True
	for i in graph[u]:
		if not visit[i]:
			dfs(i, visit, graph)
n = int(z())
t = 0
for _ in range(n):
	(a, b) = zz()
	p = b - a
	if p >= 2:
		t += 1
print(t)


def solve():
	c = 0
	for r in range(int(input())):
		(filled, empty) = map(int, input().split())
		if abs(filled - empty) >= 2:
			c += 1
	return c
print(solve())


n = int(input())
rooms = 0
for x in range(0, n):
	pq = [int(x) for x in input().split()]
	if pq[1] - pq[0] > 1:
		rooms += 1
print(rooms)


n = int(input())
i = 0
sum = 0
while i in range(n):
	(pi, qi) = map(int, input().split())
	if qi - pi - 2 < 0:
		sum = sum
	else:
		sum = sum + 1
	i += 1
print(sum)


from sys import stdin
input = stdin.readline
k = int(input())
total = 0
for _ in range(k):
	(a, b) = map(int, input().split())
	if b - a >= 2:
		total += 1
print(total)


c = 0
for _ in range(int(input())):
	(a, b) = map(int, input().split())
	if abs(a - b) >= 2:
		c += 1
print(c)


def test():
	n = int(input())
	r = 0
	while n > 0:
		(p, q) = map(int, input().split(' '))
		if q - p >= 2:
			r += 1
		n -= 1
	print(r)
test()


n = int(input())
k = 0
for i in range(n):
	(p, c) = map(int, input().split())
	if c - p > 1:
		k += 1
print(k)


n = int(input())
x = 0
for i in range(n):
	ai = [int(x) for x in input().split()]
	pi = ai[0]
	qi = ai[1]
	si = qi - pi
	if si >= 2:
		x += 1
	else:
		x = x
print(x)


ans = 0
for x in range(int(input())):
	(i, j) = [int(i) for i in input().strip().split()]
	if j - i > 1:
		ans += 1
print(ans)


n = int(input())
count = 0
while n > 0:
	(a, b) = list(map(int, input().split(' ')))
	if b - a >= 2:
		count = count + 1
	n = n - 1
print(count)


n = int(input())
i = 0
count = 0
while i < n:
	st = input()
	lis = st.split(' ')
	diff = int(lis[1]) - int(lis[0])
	if diff >= 2:
		count += 1
	i += 1
print(count)


n = int(input())
arr = []
for i in range(n):
	(p, q) = list(map(int, input().split()))
	arr.append([p, q])
count = 0
for num in arr:
	if num[0] == num[1]:
		continue
	elif num[0] < num[1] and num[1] - num[0] >= 2:
		count += 1
	if num[0] > num[1]:
		break
print(count)


n = int(input())
rooms = []
available = 0
for i in range(n):
	ai = input()
	rooms.append(ai)
for room in rooms:
	(p, q) = list(map(int, room.split()))
	if q - p >= 2:
		available += 1
print(available)


n = int(input())
l = []
for _ in range(n):
	(a, b) = map(int, input().split())
	l.append(b - a)
print(n - l.count(0) - l.count(1))


r = int(input())
mylist = []
nylist = []
for i in range(r):
	(m, n) = map(int, input().split())
	mylist.append(m)
	nylist.append(n)
count = 0
for i in range(r):
	if nylist[i] - mylist[i] >= 2:
		count += 1
	else:
		pass
print(count)


n = int(input())
cnt = 0
dorm = [input().split() for i in range(n)]
for i in range(n):
	a = [int(j) for j in dorm[i]]
	if a[1] - a[0] > 1:
		cnt += 1
print(cnt)


numberOfRooms = int(input())
numberOfFree = 0
for i in range(0, numberOfRooms):
	(p, q) = map(int, input().split(' '))
	if q - p >= 2:
		numberOfFree += 1
print(numberOfFree)


quant = int(input())
result = 0
for i in range(quant):
	rooms = input().split()
	for j in range(1, len(rooms)):
		if int(rooms[j]) - int(rooms[j - 1]) >= 2:
			result = result + 1
print(result)


cnt = 0
for _ in range(int(input())):
	(a, b) = [int(x) for x in input().split()]
	cnt += b - a >= 2
print(cnt)


import math
import sys
import string

def ri():
	return input()

def ii():
	return int(input())

def li():
	return input().split()

def mi():
	return list(map(int, input().split()))
n = ii()
c = 0
for i in range(n):
	(p, q) = mi()
	if q - p >= 2:
		c += 1
print(c)


def main():
	n = int(input())
	no_of_spaces = 0
	for i in range(n):
		(p, q) = [int(i) for i in input().split()]
		spare_space = q - p
		if spare_space >= 2:
			no_of_spaces += 1
	print(no_of_spaces)
main()


def main():
	n = int(input())
	n_available_rooms = 0
	for _ in range(n):
		[p, q] = [int(__) for __ in input().split()]
		if q - p >= 2:
			n_available_rooms += 1
	print(n_available_rooms)
main()


import re
n = int(input())
m = 0
for i in range(n):
	(a, b) = map(int, input().split())
	m += b - a > 1
print(m)


n = int(input())
for i in range(n):
	(p, m) = map(int, input().split())
	k = m - p
	if k < 2:
		n -= 1
print(n)


import math
n = int(input())
res = 0
while n > 0:
	s = input().split()
	if int(s[1]) - int(s[0]) >= 2:
		res += 1
	n -= 1
print(res)


n = int(input())
result = 0
for i in range(n):
	(people, capacity) = map(int, input().split())
	if capacity - people >= 2:
		result += 1
print(result)


n = int(input())
count = 0
for i in range(n):
	s = list(map(int, input().strip().split(' ')))
	if s[1] - 2 >= s[0]:
		count += 1
print(count)


import sys
count_places = int(input())
count_variant = 0
for i in range(0, count_places):
	(a, b) = map(int, input().split())
	if b - a >= 2:
		count_variant += 1
print(count_variant)


n = int(input())
count = 0
while n > 0:
	(x, y) = [int(x) for x in input().split()]
	if y - x >= 2:
		count += 1
	n -= 1
print(count)


class Room:

	def __init__(self, p, q):
		self.p = p
		self.q = q
n = int(input())
cnt = 0
a = []
for i in range(n):
	(p, q) = map(int, input().split(' '))
	room = Room(p, q)
	a.append(room)
for x in a:
	if x.q - x.p >= 2:
		cnt += 1
print(cnt)


t = int(input())
c = 0
for _ in range(t):
	(a, b) = input().split()
	a = int(a)
	b = int(b)
	if b - a >= 2:
		c += 1
print(c)


rooms = int(input())
count = 0
for i in range(rooms):
	data = input()
	data = data.split()
	p = int(data[0])
	q = int(data[1])
	if p <= q - 2:
		count += 1
print(count)


print(len([1 for i in [list(map(lambda x: int(x), input().split())) for i in range(int(input()))] if i[1] - i[0] > 1]))


n = int(input())
contador = 0
amigos = 2
while n != 0:
	(pi, qi) = map(int, input().split())
	if pi + amigos <= qi:
		contador += 1
	n -= 1
print(contador)


s = 0
for i in range(int(input())):
	(x, y) = map(int, input().split())
	s += y - x >= 2
print(s)


n = int(input())
r = sum((x[1] - x[0] > 1 for x in (list(map(int, input().split())) for _ in range(n))))
print(r)


test_cases = int(input())
test = test_cases
data = []
while test_cases > 0:
	data.append(input().split())
	test_cases -= 1
rooms = 0
for i in range(0, test):
	if int(data[i][1]) - int(data[i][0]) >= 2:
		rooms += 1
print(rooms)


n = int(input())
q = 0
for x in range(n):
	s = input().split()
	if int(s[0]) + 2 <= int(s[1]):
		q += 1
print(q)


n = int(input())
count = 0
for i in range(n):
	(p, q) = [int(x) for x in input().split()]
	count += int(p + 2 <= q)
print(count)


n = int(input())
count = 0
for i in range(n):
	y = input()
	a = []
	a = y.split()
	a[0] = int(a[0])
	a[1] = int(a[1])
	if a[1] - a[0] >= 2:
		count += 1
print(count)


n = int(input())
arr = []
count = 0
for i in range(n):
	tup = tuple(map(int, input().split()))
	arr.append(tup)
for (p, q) in arr:
	if q - p >= 2:
		count += 1
print(count)


N = int(input())
l = [input().split(' ') for i in range(N)]
c = 0
for i in range(len(l)):
	if abs(int(l[i][0]) - int(l[i][1])) >= 2:
		c += 1
print(c)


rooms = int(input())
count = 0
for i in range(rooms):
	a = list(map(int, input().split()))
	if a[1] - a[0] >= 2:
		count += 1
print(count)


am = int(input())
count = 0
for i in range(am):
	(live, maxx) = map(int, input().split())
	if maxx - live >= 2:
		count = count + 1
	else:
		count = count
print(count)


n = int(input())
ans = 0
for i in range(n):
	(p, q) = map(int, input().split())
	ans += q - p > 1
print(ans)


number = int(input())
result = 0
for i in range(number):
	(lives, max) = map(int, input().split())
	if lives + 2 <= max:
		result += 1
print(result)


n = int(input())
t = 0
for i in range(0, n):
	str = input()
	a = int(str.split()[0])
	b = int(str.split()[1])
	if b >= a + 2:
		t += 1
print(t)


s = int(input())
result = 0
for i in range(s):
	a = input().split()
	p = int(a[0])
	q = int(a[1])
	if q - 2 - p >= 0:
		result += 1
print(result)


def iip():
	return int(input())

def sip():
	return input()

def mip():
	return map(int, input().split())

def lip():
	return list(map(int, input().split()))
t = iip()
count = 0
while t:
	t -= 1
	(p, q) = map(int, input().split())
	if q - p >= 2:
		count += 1
print(count)


n = int(input())
z = 0
for i in range(n):
	(k, m) = map(int, input().split())
	if m - k >= 2:
		z = z + 1
print(z)


komnati = 0
num = int(input())
for __ in range(num):
	ludi_mesto = list(map(int, input().split()))
	if ludi_mesto[0] <= ludi_mesto[1] - 2:
		komnati += 1
	ludi_mesto.clear()
print(komnati)


rooms = int(input())
free_room = 0
for _ in range(rooms):
	(p, q) = list(map(int, input().split(' ')))
	if q - p >= 2:
		free_room += 1
print(free_room)


x = int(input())
l = []
c = 0
for i in range(x):
	y = input()
	y = y.split()
	for j in y:
		j = int(j)
		l.append(j)
	if l[1] - l[0] >= 2:
		c += 1
	del l[:]
print(c)


n = int(input())
a = [0] * n
b = [0] * n
for i in range(0, n):
	r = input().split(' ')
	a[i] = int(r[0])
	b[i] = int(r[1])
cnt = 0
for i in range(0, n):
	cnt += 1 if a[i] + 2 <= b[i] else 0
print(cnt)


n = int(input())
x = []
m = 0
for i in range(n):
	a = input().split()
	w = int(a[1]) - int(a[0])
	if w >= 2:
		m = m + 1
	else:
		m = m
print(m)


a = int(input())
count = 0
for i in range(a):
	b = input()
	lst = b.split()
	p = int(lst[0])
	q = int(lst[1])
	if q - p >= 2:
		count += 1
print(count)


x = int(input())
t = 0
for i in range(x):
	l = lambda : map(int, input().split())
	y = list(l())
	if y[1] - y[0] >= 2:
		t = t + 1
	else:
		continue
print(t)


c = 0
for _ in range(int(input())):
	(a, b) = map(int, input().split())
	c += int(b - a >= 2)
print(c)


n = int(input())
f = 0
for i in range(n):
	(p, c) = map(int, input().split())
	if c - 2 >= p:
		f += 1
print(f)


n = int(input())
available = 0
for i in range(n):
	rooms = input().split()
	room = rooms[0]
	total = rooms[1]
	if int(total) - int(room) > 1:
		available += 1
print(available)


n = int(input())
sk = 0
p = [0] * 101
q = [0] * 101
for i in range(n):
	k = input()
	r = k.split()
	p[i] = int(r[0])
	q[i] = int(r[1])
	if q[i] - p[i] > 1:
		sk += 1
print(sk)


x = int(input())
rooms = 0
for i in range(x):
	(p, q) = map(int, input().split())
	if q - p >= 2:
		rooms += 1
	else:
		rooms += 0
print(rooms)


from collections import deque, Counter, OrderedDict
from heapq import nsmallest, nlargest

def binNumber(n, size):
	return bin(n)[2:].zfill(size)

def gcd(a, b):
	if a == 0:
		return b
	return gcd(b % a, a)

def iar():
	return list(map(int, input().split()))

def ini():
	return int(input())

def isp():
	return map(int, input().split())

def sti():
	return str(input())
n = ini()
k = 0
for _ in range(n):
	(p, q) = isp()
	if q - p >= 2:
		k += 1
print(k)


n = int(input())
M = []
for i in range(n):
	M.append([int(x) for x in input().split()])
p = 0
for i in range(n):
	if M[i][0] <= M[i][1] - 2:
		p += 1
print(p)


n = int(input())
avail = 0
while n:
	(p, q) = input().split()
	p = int(p)
	q = int(q)
	if q - p >= 2:
		avail += 1
	n -= 1
print(avail)


k = int(input())
count = 0
for i in range(k):
	str1 = input()
	str1 = list(str1.split(' '))
	if int(str1[1]) - int(str1[0]) >= 2:
		count += 1
print(count)


n = int(input())
cnt = 0
for i in range(n):
	l = [int(x) for x in input().split()]
	(p, q) = (l[0], l[1])
	if q - p >= 2:
		cnt += 1
print(cnt)


a = int(input())
t = 0
for x in range(0, a):
	b = input()
	b = b.split()
	if int(b[1]) - int(b[0]) > 1:
		t = t + 1
print(t)


n = int(input())
c = 0
while n > 0:
	(i, j) = map(int, input().split())
	if j - i >= 2:
		c = c + 1
	n = n - 1
print(c)


x = int(input())
c = 0
for i in range(x):
	y = list(input().split(' '))
	if int(y[0]) < int(y[1]) and int(y[1]) - int(y[0]) >= 2:
		c += 1
print(c)


def rooms():
	a = int(input())
	cnt = 0
	for i in range(a):
		rooms = list(map(int, input().split()))
		if rooms[0] < rooms[1] - 1:
			cnt += 1
	return cnt
print(rooms())


n = int(input())
count = 0
p = 0
while count < n:
	groups = [int(a) for a in input().split(' ')]
	count = count + 1
	if groups[1] - groups[0] >= 2:
		p = p + 1
print(p)


n = int(input())
kol = 0
for i in range(0, n):
	a = [int(x) for x in input().split(' ')]
	if a[1] - a[0] > 1:
		kol += 1
print(kol)


n = int(input())
room = [[int(i) for i in input().split()] for j in range(n)]
c = list(map(lambda x: abs(x[0] - x[1]), room))
free = list(filter(lambda x: x > 1, c))
print(len(free))


z = int(input(''))
m = 0
for c in range(z):
	(x, y) = map(int, input().split())
	if y - x >= 2:
		m += 1
	x = y = 0
print(m)


s = 0
for i in range(int(input())):
	t = tuple(map(int, input().split()))
	s += int(t[1] - t[0] >= 2)
print(s)


a = int(input())
b = list()
c = 0
for i in range(a):
	b.append(input().split())
for i in b:
	if int(i[1]) - int(i[0]) >= 2:
		c = c + 1
print(c)


rooms = int(input())
p = []
q = []
for i in range(rooms):
	(x, y) = input().split()
	p.append(int(x))
	q.append(int(y))
count = 0
for i in range(rooms):
	if q[i] - p[i] >= 2:
		count += 1
	else:
		count += 0
print(count)


result = 0
for maxCase in range(int(input())):
	(p, q) = map(int, input().split())
	if p + 2 <= q:
		result += 1
print(result)


n = int(input())
count = 0
for _ in range(n):
	r = input().strip().split(' ')
	if int(r[1]) - int(r[0]) >= 2:
		count += 1
print(count)


n = int(input())
(c, f) = (0, 0)
for i in range(n):
	(a, b) = [int(i) for i in input().split()]
	if a + 2 <= b:
		c = c + 1
print(c)


b = int(input())
count = 0
for i in range(b):
	l = list(map(int, input().split()))
	if l[1] - l[0] >= 2:
		count = count + 1
print(count)


p = int(input())
chances = 0
for i in range(p):
	(n, b) = [int(i) for i in input().split()]
	if b - n >= 2:
		chances += 1
print(chances)


d = int(input())
cntr = 0
for i in range(d):
	(p, s) = list(map(int, input().split()))
	if s - p >= 2:
		cntr += 1
print(cntr)


r = int(input())
(room, n) = ([], 0)
for i in range(r):
	a = list(map(int, input().split(' ')))
	room.append(a)
for i in range(r):
	c = room[i][1] - room[i][0]
	if c >= 2:
		n += 1
print(n)


counter = 0
for _ in range(int(input())):
	(p, q) = list(map(int, input().split()))
	if q - p >= 2:
		counter += 1
print(counter)


n = int(input())
rooms = 0
for i in range(n):
	tmp = input()
	(p, q) = map(int, tmp.split())
	if q - p >= 2:
		rooms += 1
print(rooms)


n = int(input())
sol = 0
for i in range(n):
	x = input().split()
	x = [int(j) for j in x]
	if x[0] + 2 <= x[1]:
		sol = sol + 1
print(sol)


n = int(input())
z = 0
for i in range(n):
	(m, mm) = map(int, input().split())
	if mm - m > 1:
		z += 1
print(z)


get = lambda : list(map(int, input().split()))
n = int(input())
ans = 0
for i in range(n):
	(a, b) = get()
	if b - a >= 2:
		ans += 1
print(ans)


repetition = int(input())
rooms_available = 0
for times in range(repetition):
	(people, capacity) = map(int, input().split())
	if people + 2 <= capacity:
		rooms_available += 1
print(rooms_available)


c = 0
for i in ' ' * int(input()):
	t = [int(i) for i in input().split()]
	c += t[1] - t[0] > 1
print(c)


nd = 0
for _ in range(int(input())):
	(p, q) = [int(i) for i in input().split()]
	if p + 2 <= q:
		nd += 1
print(nd)


x = int(input())
ans = 0
for i in range(x):
	(m, n) = tuple(map(int, input().split()))
	if m <= n - 2:
		ans += 1
print(ans)


n = int(input())
d = 0
for i in range(0, n):
	line = input().split(' ')
	x = int(line[1]) - int(line[0])
	if x >= 2:
		d += 1
print(d)


a = int(input())
b = 0
for i in range(a):
	(c, d) = map(int, input().split())
	e = d - c
	if e >= 2:
		b += 1
print(b)


n = int(input())
sum = 0
import math
while n > int(0):
	(p, q) = map(int, input().split())
	n -= 1
	if q - p >= 2:
		sum += 1
print(sum)


n = int(input())
c = 0
for _ in range(n):
	(n1, n2) = list(map(int, input().split()))
	if n2 - n1 >= 2:
		c += 1
print(c)


n = input()
rooms = [input() for i in range(int(n))]
count = 0
for i in rooms:
	x = i.split()
	if int(x[1]) - int(x[0]) >= 2:
		count += 1
	else:
		count += 0
print(count)


n = int(input())
print(sum((eval(input().replace(' ', '-')) < -1 for i in range(n))))


n = int(input())
i = 1
fn = 0
while i <= n:
	(p, q) = input().split()
	q = int(q)
	p = int(p)
	if q - p >= 2:
		fn += 1
		i += 1
	else:
		i += 1
print(fn)


n = int(input())
acc = 0
c = 0
while n:
	n -= 1
	(p, q) = [int(x) for x in input().split()]
	acc = q - p
	if acc >= 2:
		c += 1
print(c)


n = int(input())
r = list()
for i in range(n):
	temp = input().split()
	r += [[int(temp[0]), int(temp[1])]]
count = 0
for i in range(n):
	if r[i][1] - r[i][0] > 1:
		count += 1
print(count)


num = int(input())
count = 0
while num:
	temp = list(map(int, input().split()))
	if temp[1] - temp[0] >= 2:
		count += 1
	num -= 1
print(count)


n = int(input())
lst = []
sol = 0
for i in range(0, n):
	lst = list(map(int, input().strip().split()))
	if lst[1] - lst[0] >= 2:
		sol += 1
print(sol)


n = int(input())
count = 0
for i in range(n):
	(initially, capacity) = [int(x) for x in input().split()]
	if capacity - initially >= 2:
		count += 1
print(count)


number_of_rooms = int(input())
empty_rooms = []
len(empty_rooms)
while number_of_rooms:
	number_of_people_and_capacity = input()
	number_of_rooms -= 1
	people = number_of_people_and_capacity[:number_of_people_and_capacity.index(' ')]
	capacity = number_of_people_and_capacity[number_of_people_and_capacity.index(' '):]
	if '...' in capacity:
		capacity = capacity.replace('...', '')
	if int(capacity) - int(people) >= 2:
		empty_rooms.append('room')
print(len(empty_rooms))


x = int(input())
y = []
while x != 0:
	y = y + input().split()
	x -= 1
a = y[0::2]
b = y[1::2]
p = 0
for (i, j) in zip(a, b):
	r = int(i) - int(j)
	if abs(r) > 1:
		p += 1
print(p)


n = int(input())
k = 0
for i in range(1, n + 1):
	(zhivut, mogut) = map(int, input().split())
	if mogut - zhivut >= 2:
		k = k + 1
print(k)


n = int(input())
count = 0
for i in range(n):
	(current_people, max_people) = map(int, input().split())
	if max_people - current_people >= 2:
		count += 1
print(count)


def prog():
	n = int(input())
	k = 0
	for i in range(n):
		(a, b) = map(int, input().split())
		if b - a >= 2:
			k += 1
	print(k)
prog()


l = 0
k = int(input())
while k:
	(m, n) = map(int, input().split())
	k -= 1
	if n - m >= 2:
		l += 1
print(l)


n = int(input())
i = 1
d = 0
while i <= n:
	(g, q) = input().split()
	g = int(g)
	q = int(q)
	if q - g >= 2:
		d = d + 1
	i = i + 1
print(d)


n = int(input())
m = 0
for i in range(n):
	(pi, qi) = input().split()
	remain = int(qi) - int(pi)
	if remain >= 2:
		m = m + 1
print(m)


c = 0
n = int(input())
for i in range(n):
	(p, t) = map(int, input().strip().split())
	if t - p >= 2:
		c += 1
print(c)


import sys
input = sys.stdin.readline

def main():
	n = int(input())
	ans = 0
	for _ in range(n):
		(p, q) = map(int, input().split())
		if p <= q - 2:
			ans += 1
	print(ans)
main()


t = int(input())
c = 0
while t > 0:
	t = t - 1
	l = list(map(int, input().split()))
	if l[0] + 2 <= l[1]:
		c = c + 1
print(c)


n = int(input())
l = []
for i in range(n):
	r = list(input().split())
	l.append(r)
count = 0
for i in range(n):
	if int(l[i][0]) < int(l[i][1]) and int(l[i][1]) - int(l[i][0]) >= 2:
		count = count + 1
print(count)


import sys, math

def rs():
	return sys.stdin.readline().strip()

def ri():
	return int(sys.stdin.readline().strip())

def ras():
	return list(sys.stdin.readline().strip())

def rai():
	return map(int, sys.stdin.readline().strip().split())

def raf():
	return map(float, sys.stdin.readline().strip().split())

def solve():
	count = 0
	n = ri()
	for i in range(n):
		(p, q) = rai()
		if p <= q - 2:
			count += 1
	return count
print(solve())


def main():
	n = int(input())
	c = 0
	for _ in range(n):
		(p, q) = map(int, input().split())
		if p + 2 <= q:
			c += 1
	print(c)
main()


a = int(input())
L = []
count = 0
for i in range(a):
	(x, y) = input().split()
	L.append(int(x))
	L.append(int(y))
i = 0
while i < len(L):
	s = L[i]
	p = L[i + 1]
	if p - s >= 2:
		count = count + 1
		i = i + 2
	else:
		i = i + 2
print(count)


n = int(input())
m = 0
t = True
x = 0
while t:
	(a, b) = map(int, input().split())
	m += 1
	if b - a >= 2:
		x += 1
	if m == n:
		t = False
print(x)


n = int(input())
(p, q) = ([], [])
possible_rooms_count = 0
for i in range(0, n, 1):
	input_string = input()
	input_numbers = [int(x) for x in input_string.split(' ')]
	p.append(input_numbers[0])
	q.append(input_numbers[1])
	if q[i] - p[i] > 1:
		possible_rooms_count += 1
print(str(possible_rooms_count))


import sys
n = 0
kc = 0
endVal = 0
values = 1
for l in sys.stdin:
	if n == 0:
		n = n + 1
		values = int(l.strip())
		continue
	else:
		for k in l.strip().split():
			if kc == 0:
				k1 = int(k)
				kc = kc + 1
			else:
				k2 = int(k)
				kc = 0
				if k2 - k1 > 1:
					endVal = endVal + 1
	values = values - 1
	if values == 0:
		break
print(endVal)


def seperateints(x):
	k = ''
	l = []
	for i in x:
		if i == ' ':
			l.append(int(k))
			k = ''
			continue
		k = k + i
	l.append(int(k))
	return l
n = int(input())
l = []
for i in range(n):
	l.append(seperateints(input()))
k = 0
for i in l:
	if i[1] - i[0] >= 2:
		k += 1
print(k)


n = int(input())
sum = 0
for i in range(n):
	(s0, s1) = map(int, input().split())
	if s1 - s0 >= 2:
		sum += 1
print(sum)


def solve(allRoom):
	count = 0
	for room_value in allRoom:
		if room_value[1] - room_value[0] >= 2:
			count += 1
	return count
n = int(input())
allRoom = list()
while n > 0:
	room_value = list(map(int, input().split(' ')))
	allRoom.append(room_value)
	n -= 1
print(solve(allRoom))


n = int(input())
ans = 0
for i in range(n):
	(living, cap) = [int(x) for x in input().strip().split()]
	if cap - living >= 2:
		ans += 1
print(ans)


import math
import os
import random
import re
import sys
m = int(input())
count = 0
for i in range(m):
	a = [int(x) for x in input().split()]
	if a[1] - a[0] >= 2:
		count = count + 1
print(count)


class Room:

	def __init__(self, cur, limit):
		self.cur = cur
		self.limit = limit

	def Space(self):
		return self.limit - self.cur > 1
n = int(input())
a = []
for n in range(n):
	(x, y) = map(int, input().split())
	a.append(Room(x, y))
ans = 0
for i in a:
	if i.Space():
		ans += 1
print(ans)


n = int(input())
lista = []
for i in range(0, n):
	(p, q) = map(int, input().split())
	lista.append(q - p)
	i = i + 1
count = 0
for i in range(0, len(lista)):
	if lista[i] >= 2:
		count = count + 1
print(count)


stop = []
count = 0
for i in range(0, int(input())):
	for j in range(0, 1):
		a = list(map(int, input().split()))
		stop.append(a)
for i in range(len(stop)):
	if stop[i][1] - stop[i][0] >= 2:
		count = count + 1
print(count)


n = int(input())
out = 0
for i in range(n):
	v = list(map(int, input().split()))
	if v[1] - v[0] >= 2:
		out += 1
print(out)


numberOfRooms = input('')
rooms = dict()
availableRooms = 0
for room in range(int(numberOfRooms)):
	roomInfo = input('').split(' ')
	rooms[room] = {'People:': roomInfo[0], 'Capacity:': roomInfo[1]}
	if int(rooms[room]['People:']) + 1 < int(rooms[room]['Capacity:']):
		availableRooms = availableRooms + 1
print(availableRooms)


n = int(input())
cnt = 0
for i in range(n):
	(a, b) = [int(x) for x in input().split()]
	cnt += b - a >= 2
print(cnt)


hat = int(input())
lst = []
Eroom = 0
for i in range(hat):
	lst.append(input().split())
for i in range(hat):
	if int(lst[i][1]) - int(lst[i][0]) >= 2:
		Eroom += 1
print(Eroom)


def roomcount(l):
	c = 0
	for x in l:
		(a, b) = x
		if b - a >= 2:
			c += 1
	return c
n = int(input())
l = list()
for i in range(n):
	k = tuple(map(int, input().split()))
	l.append(k)
print(roomcount(l))


n = input()
s = []
for i in range(int(n)):
	(b, a) = map(int, input().split())
	s += [a - b > 1]
print(sum(s))


n = int(input())
s = 0
c = 0
for i in range(n):
	li = [int(num) for num in input().split()]
	x1 = int(li[0])
	x2 = int(li[1])
	s = x2 - x1
	if s >= 2:
		c = c + 1
print(c)


room_counts = int(input())
boys_room = 0
for boys in range(room_counts):
	(people_counts, people_limit) = map(int, input().split())
	if people_counts + 2 <= people_limit:
		boys_room += 1
print(boys_room)


n = int(input())
c = 0
for i in range(n):
	(pi, qi) = list(map(int, input().split()))
	if qi - pi > 1:
		c = c + 1
print(c)


def cn(v):
	return len([x for x in v if x[1] - x[0] > 1])
n = int(input())
v = []
for _ in range(n):
	v.append([int(x) for x in input().split()])
print(cn(v))


k = int(input())
m = []
for i in range(k):
	s = str(input())
	s = s.split()
	m = m + [s]
w = 0
for i in range(k):
	z = int(m[i][1]) - int(m[i][0])
	if z >= 2:
		w = w + 1
print(w)


def main():
	rooms = int(input())
	chances = 0
	for room in range(0, rooms):
		(reality, expectations) = list(map(int, input().split()))
		if expectations - reality >= 2:
			chances += 1
	print(str(chances))
main()


a = int(input())
b = []
k = 0
l = 0
m = 0
for i in range(a):
	c = input()
	d = c.split()
	b.append(d)
for j in range(a):
	k = int(b[j][1]) - int(b[j][0])
	if k >= 2:
		l = l + 1
print(l)


n = int(input())
places = 0
for i in range(0, n):
	room_state = input().split(' ')
	p = int(room_state[0])
	q = int(room_state[1])
	if q - p >= 2:
		places += 1
print(places)


x = int(input())
n = 0
for i in range(x):
	f = [int(b) for b in input().split()]
	if f[1] - f[0] >= 2:
		n += 1
print(n)


n = int(input())
count = 0
while n > 0:
	(Pi, Qi) = [int(s) for s in input().split()]
	if Qi - Pi >= 2:
		count += 1
	n -= 1
print(count)


s = 0
for i in range(int(input())):
	a = [int(i) for i in input().split()]
	if a[1] - a[0] >= 2:
		s += 1
	else:
		pass
print(s)


p = int(input())
i = 0
ans = 0
while i < p:
	i = i + 1
	(n, m) = map(int, input().split())
	if m - n >= 2:
		ans = ans + 1
print(ans)


a = int(input())
c = 0
for i in range(a):
	b = input().strip().split(' ')
	p = int(b[0])
	q = int(b[1])
	if p + 2 <= q:
		c += 1
print(c)


N = int(input())
n = 0
X = 0
while n < N:
	n += 1
	Y = [int(x) for x in input().split()]
	if Y[0] + 1 < Y[1]:
		X += 1
print(X)


n = int(input())
s = 0
for k in range(n):
	l = input().split(' ')
	p = int(l[0])
	q = int(l[1])
	if p < q - 1:
		s += 1
print(s)


def zaselenie(lst1, lst2):
	count = 0
	for i in range(len(lst1)):
		if lst2[i] - lst1[i] >= 2:
			count += 1
	return count
n = int(input())
(P, Q) = (list(), list())
for i in range(n):
	(p, q) = [int(i) for i in input().split()]
	P.append(p)
	Q.append(q)
print(zaselenie(P, Q))


n = int(input(''))
cnt = 0
for i in range(n):
	(rn, full) = map(int, input().split())
	if full - rn >= 2:
		cnt += 1
print(cnt)


n = int(input())
room = 0
for i in range(1, n + 1):
	m = list(map(int, input().split()))
	if m[0] <= m[1] - 2:
		room += 1
print(room)


a = 0
for _ in range(int(input())):
	(x, y) = map(int, input().split())
	if y - x >= 2:
		a += 1
print(a)


n = int(input())
count = 0
while True:
	(p, q) = map(int, input().split())
	if q - p >= 2:
		count += 1
	n -= 1
	if n == 0:
		break
print(count)


n = int(input())
L = []
for i in range(n):
	[p, q] = [int(i) for i in input().split(' ')]
	if q - p >= 2:
		L.append(q - p)
print(len(L))


n = eval(input())
r = 0
while n > 0:
	(p, q) = map(int, input().split())
	if q - p >= 2:
		r += 1
	n -= 1
print(r)


t = int(input())
c = 0
for _ in range(t):
	(x, y) = map(int, input().split())
	if abs(x - y) >= 2:
		c += 1
print(c)


n = int(input())
i = 0
num = list()
while i < n:
	num.append(input())
	i += 1
arr = []
for i in num:
	count = 0
	for j in range(0, len(i)):
		if i[j] == ' ':
			arr.append(int(i[count:j]))
			count = j + 1
		elif j == len(i) - 1:
			arr.append(int(i[count:len(i)]))
counting = 0
for i in range(0, len(arr), 2):
	if arr[i + 1] - arr[i] >= 2:
		counting += 1
print(counting)


number_of_rooms = 0
tests = int(input())
while tests > 0:
	(p, q) = input().split()
	(p, q) = (int(p), int(q))
	if q - p >= 2:
		number_of_rooms += 1
	tests -= 1
print(number_of_rooms)


n = int(input())
value = 0
for i in range(n):
	(p, q) = str(input()).split()
	if int(q) - int(p) >= 2:
		value += 1
print(value)


n = int(input())
l = []
count = 0
for i in range(n):
	l.extend([int(x) for x in input().split()])
for i in range(0, 2 * n, 2):
	if l[i + 1] - l[i] >= 2:
		count += 1
print(count)


room = int(input())
allowed_rooms = 0
for i in range(room):
	(living, capacity) = [int(i) for i in input().split()]
	if capacity - living >= 2:
		allowed_rooms = allowed_rooms + 1
print(allowed_rooms)


n = int(input())
from functools import reduce
print(len(list(filter(lambda x: x > 1, [reduce(lambda x, y: y - x, list(map(int, input().split()))) for i in range(n)]))))


n = int(input())
c = 0
for i in range(0, n):
	s = input()
	y = s.split()
	y[0] = int(y[0])
	y[1] = int(y[1])
	if y[1] - y[0] >= 2:
		c = c + 1
	else:
		continue
print(c)


import sys
n = sys.stdin.readline()
rooms = []
for i in range(int(n)):
	rooms.append(list(map(int, sys.stdin.readline().split())))
ans = 0
for i in range(int(n)):
	if rooms[i][1] - rooms[i][0] >= 2:
		ans = ans + 1
print(str(ans))


n = int(input())
k = [[int(i) for i in input().split()] for j in range(n)]
count = 0
for p in range(n):
	if abs(k[p][0] - k[p][1]) >= 2:
		count += 1
print(count)


def check(p, q):
	if q - 2 >= p:
		return 1
	else:
		return 0
num_rooms = int(input())
count = 0
for i in range(num_rooms):
	room = input().split()
	count = count + check(int(room[0]), int(room[1]))
print(count)


f = 0
for _ in range(int(input())):
	(p, q) = input().split()
	p = int(p)
	q = int(q)
	if q - p >= 2:
		f += 1
print(f)


def get():
	res = [int(x) for x in input().split()]
	return res[0] if len(res) == 1 else res
n = get()
r = 0
for _ in range(n):
	(a, b) = get()
	if a + 2 <= b:
		r += 1
print(r)


from sys import stdin
rooms = int(stdin.readline().rstrip())
capacities = [int(x) for x in stdin.read().rstrip().split()]
free_space = list(filter(lambda rnr: capacities[rnr + 1] - capacities[rnr] > 1, range(0, len(capacities), 2)))
print(len(free_space))


num = int(input())
count = 0
for i in range(num):
	a = []
	a = list(map(int, input().strip().split()))[:2]
	diff = abs(a[0] - a[1])
	if diff >= 2:
		count += 1
print(count)


n = int(input())
t = 0
for z in range(n):
	(x, y) = [int(z) for z in input().split()]
	t += int(y) - int(x) >= 2
print(t)


n = int(input())
a = []
for i in range(n):
	temp = list(map(int, input().split()))
	a.append(temp[1] - temp[0])
s = 0
for i in range(len(a)):
	if a[i] > 1:
		s += 1
print(s)


n = int(input())
res = 0
for i in range(n):
	lis = list(map(int, input().split(' ')))
	if lis[1] - lis[0] >= 2:
		res += 1
print(res)


n = int(input())
listy = [input() for _ in range(n)]
count = 0
for i in listy:
	i = i.split(' ')
	if int(i[0]) + 1 < int(i[1]):
		count += 1
print(count)


rooms = int(input())
space1 = 0
for i in range(0, rooms):
	(x, y) = input().split()
	if int(y) - int(x) >= 2:
		space1 = space1 + 1
print(space1)


f = []
t = int(input())
count = 0
g = []
for i in range(t):
	(a, b) = map(int, input().split())
	f.append(a)
	g.append(b)
for i in range(len(f)):
	if g[i] - 2 >= f[i]:
		count += 1
print(count)


T = int(input())
p = []
q = []
for i in range(T):
	(temp1, temp2) = map(int, input().strip().split())
	p.append(temp1)
	q.append(temp2)
count = 0
for i in range(len(p)):
	if q[i] - p[i] >= 2:
		count += 1
print(count)


from sys import stdin, stdout

def main():
	n = int(stdin.readline().rstrip())
	rooms = []
	for num in range(0, n):
		rooms.append(list(map(int, stdin.readline().rstrip().split())))
	moveIn = 0
	for room in rooms:
		if room[1] - room[0] >= 2:
			moveIn += 1
	stdout.write(str(moveIn) + '\n')
main()


def main(n, lst):
	count = 0
	for i in range(n):
		if int(lst[i][1]) - int(lst[i][0]) >= 2:
			count += 1
	return count
n = int(input())
lst = []
for _ in range(n):
	lst.append(input().split())
print(main(n, lst))


from math import *

def main():
	n = int(input())
	ans = 0
	for i in range(n):
		(p, q) = map(int, input().split())
		if q - p >= 2:
			ans += 1
	print(ans)
main()


m = int(input())
t = []
count = 0
for i in range(m):
	t.append([int(x) for x in input().split()])
for i in t:
	if i[1] - i[0] >= 2:
		count += 1
print(count)


d = 0
t = int(input())
for r in range(t):
	r = [int(x) for x in input().split()]
	if r[1] - r[0] >= 2:
		d += 1
print(d)


n = int(input())
a = []
for i in range(n):
	s = [int(i) for i in input().split()]
	a.append(s)
count = 0
for i in range(n):
	if a[i][1] - a[i][0] > 1:
		count += 1
print(count)


def main():
	n = int(input())
	rooms = 0
	while n > 0:
		n -= 1
		(people, spots) = [int(i) for i in input().split(' ')]
		if spots - people > 1:
			rooms += 1
	print(rooms)
main()


n = int(input())
pos = 0
for _ in range(n):
	(x, y) = input().split()
	people = int(x)
	rooms = int(y)
	if rooms - people >= 2:
		pos += 1
	elif rooms - people <= 1:
		pos += 0
print(pos)


n = int(input())
j = 0
for i in range(n):
	(x, y) = map(int, input().split())
	a = y - x
	if a > 1:
		j = j + 1
print(j)


t = int(input())
h = []
for i in range(t):
	p = list(map(int, input().split()))
	h.append(p)
count = 0
for i in range(t):
	if h[i][1] - h[i][0] >= 2:
		count += 1
print(count)


n = int(input())
cnt = 0
a = []
for i in range(n):
	a.append([int(j) for j in input().split()])
for i in range(n):
	if a[i][1] - a[i][0] >= 2:
		cnt += 1
print(str(cnt))


n = int(input())

def roomGenerator(n):
	for x in range(n):
		thisRoomIp = input().split(' ')
		thisRoom = [int(x) for x in thisRoomIp]
		yield (thisRoom[1] - thisRoom[0])
count = 0
for x in roomGenerator(n):
	count += 1 if x >= 2 else 0
print(count)


k = input()
k = int(k)
x = 0
for i in range(k):
	a = input().split(' ')
	a = list(map(int, a))
	if a[1] - a[0] >= 2:
		x += 1
print(x)


n = int(input())
l = []
for i in range(n):
	(a, b) = map(int, input().split())
	if b - a >= 2:
		l.append(1)
	else:
		l.append(0)
print(sum(l))


input_list = []
num = 0
while True:
	if num != 0 and num == input_list[0][0] + 1:
		break
	line = input()
	line = line.split()
	line = list(map(int, line))
	input_list.append(line)
	num += 1
input_list.__delitem__(0)
count = 0
for room in input_list:
	if room[0] + 2 <= room[1]:
		count += 1
print(count)


y = int(input())
k = []
for i in range(y):
	(x, z) = input().split()
	z = int(z)
	x = int(x)
	b = z - x
	if b >= 2:
		k.append(b)
print(len(k))


n = int(input())
list1 = []
for i in range(0, n, 1):
	list2 = [int(i) for i in input().split()]
	list1.append(list2)
x = 0
for i in range(0, n, 1):
	if list1[i][1] - list1[i][0] >= 2:
		x = x + 1
print(x)


count = 0
for _ in range(int(input())):
	(i, j) = map(lambda x: int(x), input().split())
	if j - i >= 2:
		count += 1
print(count)


n = int(input())
lst = []
for i in range(0, n):
	lst.append(list(map(int, input().split())))
res = 0
for i in range(0, n):
	if lst[i][0] + 2 <= lst[i][1]:
		res += 1
print(res)


num = int(input())
count = 0
for i in range(num):
	(live, maks) = map(int, input().split())
	if live + 2 <= maks:
		count += 1
print(count)


rooms = int(input())
ans = 0
for r in range(rooms):
	(x, y) = list(map(int, input().split()))
	if y - x >= 2:
		ans += 1
print(ans)


def main():
	n = int(input())
	arr = [input().split() for i in range(n)]
	count = 0
	for i in range(n):
		if int(arr[i][1]) - int(arr[i][0]) >= 2:
			count += 1
	print(count)
main()


n = int(input())
m = 0
for i in range(n):
	(k, l) = [int(x) for x in input().split()]
	if k + 2 <= l:
		m += 1
print(m)


def main():
	n = int(input().split()[0])
	count = 0
	for _ in range(n):
		(a, b) = map(int, input().split())
		count += a + 2 <= b
	print(count)
main()


x = int(input())
(S, SP) = ([], [])
for i in range(x):
	(z, y) = map(int, input().split())
	S.append(z)
	SP.append(y)
count = 0
for j in range(x):
	if -S[j] + SP[j] >= 2:
		count += 1
print(count)


n = int(input())
counter = 0
for a in range(n):
	(people, capac) = list(map(int, input().split()))
	if capac - people > 1:
		counter += 1
print(counter)


a = int(input())
counter = 0
for i in range(0, a):
	reg = input().split()
	p = int(reg[0])
	q = int(reg[1])
	if q - p >= 2:
		counter += 1
print(counter)


print(sum((eval(input().replace(' ', '-')) < -1 for _ in ' ' * int(input()))))


n = int(input())
c = 0
i = 0
while i < n:
	a = input()
	b = list(a.split())
	if int(b[1]) - int(b[0]) > 1:
		c = c + 1
	i = i + 1
print(c)


def possible_rooms(n, arr):
	count = 0
	for i in range(n):
		if arr[i][1] - arr[i][0] >= 2:
			count = count + 1
	print(count)
p = []
q = []
n = int(input(''))
for i in range(n):
	p = list(map(int, input('').split()))
	q.append(p)
possible_rooms(n, q)


roomCount = int(input())
result = 0
for i in range(roomCount):
	room = [int(x) for x in input().split()]
	if room[1] - room[0] >= 2:
		result += 1
print(result)


num = int(input())
matrix = [list(map(int, input().split())) for i in range(num)]
count = 0
for i in range(num):
	if matrix[i][1] - matrix[i][0] >= 2:
		count += 1
print(count)


N = int(input())
res = 0
for i in range(N):
	(p, q) = map(int, input().split(' '))
	if q - p > 1:
		res += 1
print(res)


n = int(input())
count = 0
for rooms in range(n):
	(p, q) = map(int, input().split())
	if q - p > 0 and q - p >= 2:
		count += 1
print(count)


n = int(input())
l = []
for i in range(n):
	s = input()
	a = s.split()[0]
	b = s.split()[1]
	l.append(a)
	l.append(b)
nb = 0
for i in range(0, len(l) - 1, 2):
	r = int(l[i + 1]) - int(l[i])
	if r >= 2:
		nb += 1
print(nb)


n = int(input())
rooms = []
for i in range(n):
	(people, capacity) = [int(i) for i in input().split()]
	if capacity - people >= 2:
		rooms.append(1)
print(len(rooms))


room_number = int(input())
count = 0
for i in range(room_number):
	(current, capacity) = [int(x) for x in input().split()]
	if current <= capacity - 2:
		count += 1
print(count)


rooms = input()
count = 0
for x in range(int(rooms)):
	room = [int(a) for a in input().split()]
	if room[1] - room[0] > 1:
		count += 1
print(count)


import sys

def solve():
	n = int(input())
	ans = 0
	for i in range(0, n):
		(p, q) = [int(x) for x in input().split()]
		ans += 1 if q - p >= 2 else 0
	print(ans)

def main():
	solve()
main()


a = int(input())
count = 0
for i in range(0, a):
	(x, y) = map(int, input().split())
	if y - x >= 2:
		count += 1
	else:
		continue
print(count)


n = int(input())
ans = 0
for i in range(n):
	(nx, ny) = input().split()
	(nx, ny) = (int(nx), int(ny))
	if ny - nx >= 2:
		ans += 1
print(ans)


n = int(input())
L = []
k = 0
for i in range(n):
	(a, b) = map(int, input().strip().split(' '))
	L.append([a, b])
for i in range(len(L)):
	for j in range(1):
		if L[i][j + 1] - L[i][j] >= 2:
			k += 1
print(k)


count = int(input())
i = 0
rooms = []
while i < count:
	data = input()
	data = data.split()
	data[0] = int(data[0])
	data[1] = int(data[1])
	rooms.append(data)
	i += 1
free = 0
for i in rooms:
	if i[1] - i[0] >= 2:
		free += 1
	else:
		continue
print(free)


t = int(input())
b = []
while t != 0:
	t -= 1
	(n, m) = map(int, input().split())
	if m - n - 2 >= 0:
		b.append('1')
print(len(b))


n = int(input())
q = 0
for i in range(n):
	w = [x for x in input().split()]
	a = int(w[0])
	b = int(w[1])
	if b - a > 1:
		q = q + 1
print(q)


n = int(input())
cnt = 0
for a0 in range(n):
	(p, q) = input().strip().split()
	(p, q) = (int(p), int(q))
	if q - p >= 2:
		cnt += 1
print(cnt)


__author__ = 'Utena'
n = int(input())
s = [list(map(int, input().split())) for i in range(n)]
t = 0
for i in range(n):
	if s[i][1] - s[i][0] >= 2:
		t += 1
print(t)


n = int(input())
s = []
for i in range(n):
	(p, q) = map(int, input().split())
	if q - p >= 2:
		s.append(1)
print(len(s))


from array import *
n = int(input())
arr = array('i', [])
for i in range(n):
	(x, y) = map(int, input().split())
	arr.append(x)
	arr.append(y)
i = 0
j = 0
c = 0
while i < n * 2:
	if arr[i] <= arr[i + 1] - 2:
		j = j + 1
	i = i + 2
print(j)
exit()


import sys
import math
n1 = list()
habs = list()
datos = list()
personas = list()
capacidad = list()
lines = sys.stdin.readlines()
for linea in lines:
	c = linea.split()
	c = list(map(int, c))
	habs.append(c[0])
	disp = habs[0]
	for j in range(len(c) - 1):
		personas.append(c[0])
		capacidad.append(c[1])
diferencia = [x1 - x2 for (x1, x2) in zip(capacidad, personas)]
count = 0
for h in range(len(diferencia)):
	if diferencia[h] >= 2:
		count += 1
if count > 0:
	print(count)
elif count == 0:
	count = 0
	print(count)


num = int(input())
count = 0
for i in range(num):
	nums = [int(j) for j in input().split()]
	if nums[0] + 2 <= nums[1]:
		count += 1
	else:
		continue
print(count)


t = int(input())
count = 0
while t > 0:
	t -= 1
	(a, b) = map(int, input().split())
	if b - a >= 2:
		count += 1
print(count)


n = int(input())
l = []
noOfRooms = 0
for i in range(n):
	tempList = [int(x) for x in input().split()]
	l.append(tempList)
for i in range(n):
	if l[i][0] + 2 <= l[i][1]:
		noOfRooms += 1
print(noOfRooms)


ans = 0
for f in range(int(input())):
	(p, q) = map(int, input().split())
	if q - p >= 2:
		ans += 1
print(ans)


find = 0
n = int(input())
for _ in range(n):
	(m, n) = map(int, input().split())
	room = n - m
	if room >= 2:
		find += 1
print(find)


num = int(input())
rooms = []
for blarble in range(num):
	rooms.append(input().split(' '))
output = 0
for x in rooms:
	if int(x[1]) - int(x[0]) >= 2:
		output += 1
print(output)


n = int(input())
count = 0
for i in range(n):
	(l, m) = map(int, input().split())
	if abs(l - m) >= 2:
		count += 1
print(count)


n = int(input())
res = 0
for i in range(n):
	(pi, qi) = tuple(map(int, input().split()))
	if qi - pi >= 2:
		res += 1
print(res)


def ans(arr):
	cnt = 0
	for [i, j] in arr:
		if j - i >= 2:
			cnt += 1
	return cnt
t = int(input())
temp = []
for _ in range(t):
	temp.append(list(map(int, input().strip().split())))
print(ans(temp))


ans = 0
for _ in range(int(input().strip())):
	(a, b) = [int(__) for __ in input().strip().split()]
	ans += 1 if b - a >= 2 else 0
print(ans)


q = int(input())
a = list()
c = 0
a = [[0] * 2 for p in range(q)]
for i in range(q):
	a[i] = [int(j) for j in input().split(' ')]
for k in range(q):
	if a[k][1] - a[k][0] >= 2:
		c = c + 1
print(c)


no_of_rooms = input()
no_of_rooms = int(no_of_rooms)
l = []
empty_room = 0
for num in range(no_of_rooms):
	room = input().split()
	l.append(room)
for lis in l:
	if int(lis[1]) > int(lis[0]) and int(lis[1]) - int(lis[0]) >= 2:
		empty_room += 1
print(empty_room)


def int_raw():
	return int(input())

def ss_raw():
	return input().split()

def ints_raw():
	return list(map(int, ss_raw()))
N = int_raw()

def main():
	ret = 0
	for i in range(N):
		(p, q) = ints_raw()
		if q - p >= 2:
			ret += 1
	return ret
print(main())


count = 0
for i in range(int(input())):
	(ppl, room) = map(int, input().split())
	if room - ppl >= 2:
		count += 1
print(count)


a = int(input())
somme = 0
for i in range(a):
	b = input()
	b = [int(i) for i in b.split(' ')]
	if b[1] - b[0] >= 2:
		somme += 1
print(somme)


def mod():
	n = int(input())
	x = []
	g = []
	for j in range(n):
		b = list(map(int, input().split()))
		x.append(b)
	for i in range(len(x)):
		if x[i][0] == x[i][1] or x[i][0] + 1 == x[i][1]:
			g.append(0)
		else:
			g.append(1)
	print(sum(g))
mod()


total = 0
for _ in range(int(input())):
	i = list(map(int, input().split()))
	if i[1] - i[0] >= 2:
		total += 1
print(total)


k = int(input())
j = 0
for i in range(k):
	l = list(map(int, input().strip().split(' ')))
	if l[1] - l[0] >= 2:
		j = j + 1
print(j)


n = int(input())
tot = 0
for i in range(n):
	(x, c) = map(int, input().split())
	if c - x >= 2:
		tot += 1
print(int(tot))


room = int(input())
p = 0
for i in range(0, room):
	(avliable, capacity) = map(int, input().split())
	if avliable + 2 <= capacity:
		p = p + 1
print(p)


n = int(input())
count = 0
for x in range(n):
	(p, q) = list(map(int, input().split(' ')))
	if q - p >= 2:
		count = count + 1
print(count)


n = int(input())
count = 0
for i in range(n):
	list1 = [int(x) for x in input().split()]
	if (list1[1] - list1[0]) // 2 > 0:
		count = count + 1
print(count)


t = int(input())
a = 0
for i in range(t):
	(n, q) = map(int, input().split())
	if q - n >= 2:
		a = a + 1
	else:
		pass
print(a)


n = int(input())
rooms = []
available = 0
for i in range(n):
	rooms.append(str(input()).split())
for room in rooms:
	if int(room[1]) - int(room[0]) >= 2:
		available += 1
print(available)


n = int(input())
res = 0
while n:
	(x, y) = map(int, input().split())
	res += x + 1 < y
	n -= 1
print(res)


t = int(input())
c = 0
while t:
	t = t - 1
	(p, q) = map(int, input().split())
	k = 0
	if q - p >= 2:
		c = c + 1
print(c)


n = int(input())
in_user = []
count = 0
for i in range(n):
	s = input()
	in_user.append(s.split())
for j in in_user:
	if abs(int(j[0]) - int(j[1])) >= 2:
		count += 1
print(count)


cnt = 0
for _ in range(int(input())):
	(n, m) = map(int, input().split())
	if m - n >= 2:
		cnt += 1
print(cnt)


import math
from collections import defaultdict
from collections import Counter
import itertools
n = int(input())
ans = 0
while n:
	(s, e) = map(int, input().split(' '))
	if e - s >= 2:
		ans += 1
	n -= 1
print(ans)


n = int(input())
has_room = lambda a, b: int(b) - int(a) > 1
r = sum((1 for _ in range(n) if has_room(*input().split())))
print(r)


N = int(input())
n = 0
for x in range(N):
	X = [int(y) for y in input().split()]
	if X[1] - X[0] >= 2:
		n = n + 1
print(n)


n = int(input())
c = 0
for i in range(0, n):
	v = [int(x) for x in input().split()]
	(x, y) = (v[0], v[1])
	y = y - x
	if y >= 2:
		c = c + 1
print(c)


n = int(input())
count = 0
for i in range(n):
	(a, b) = map(int, input().strip().split())
	if a == b:
		pass
	elif a > b:
		pass
	elif b - a >= 2:
		count += 1
	else:
		pass
print(count)


n = int(input())
num = 0
for i in range(n):
	(p, q) = [int(x) for x in input().split()]
	if q - p >= 2:
		num += 1
	else:
		continue
print(num)


n = int(input())
data = []
for i in range(n):
	data.append(list(map(int, input().split())))

def main():
	count = 0
	for list_data in data:
		if list_data[-1] - 2 >= list_data[0]:
			count += 1
	print(count)
if __name__ == '__main__' and n >= 1 and (n <= 100):
	main()


n = int(input())
ch = 0
for i in range(n):
	(ah, bh) = map(int, input().split())
	if bh - ah >= 2:
		ch = ch + 1
print(ch)


n = int(input())
l1 = [1, 1]
l = []
for i in range(n):
	m = input().split()
	l.append(m)
s = 0
for i in l:
	if int(i[1]) - int(i[0]) >= 2:
		s += 1
print(s)


import sys
n = int(sys.stdin.readline())
rooms_count = 0
for _ in range(n):
	(p, q) = sys.stdin.readline().split()
	p = int(p)
	q = int(q)
	if q - p >= 2:
		rooms_count += 1
print(rooms_count)


pl = []
ql = []
for _ in range(int(input())):
	(p, q) = map(int, input().split())
	pl.append(p)
	ql.append(q)
room = 0
for i in range(len(pl)):
	if ql[i] - pl[i] >= 2:
		room += 1
print(room)


n = int(input())
ctr = 0
for i in range(n):
	temp = list(map(int, input().split()))
	k = temp[1] - temp[0]
	if k >= 2:
		ctr += 1
print(ctr)


n = int(input())
count = 0
for item in range(1, n + 1):
	(p, q) = map(int, input().split())
	result = q - p
	if result >= 2:
		count += 1
print(count)


num_rooms = int(input())
dat = []
for _ in range(num_rooms):
	dat.append(tuple(map(lambda x: int(x), input().split())))
valid = 0
for pair in dat:
	if pair[1] - pair[0] >= 2:
		valid += 1
print(valid)


def get_num():
	return list(map(int, input().rstrip().split()))

def main():
	num = int(input())
	x = 0
	for i in range(num):
		mylist = get_num()
		if mylist[0] + 1 < mylist[1]:
			x += 1
	print(x)
main()


n = 0
z = int(input())
for x in range(z):
	(c, v) = [int(b) for b in input().split()]
	if c + 2 <= v:
		n += 1
print(n)


rooms = int(input())
result = 0
for i in range(rooms):
	lst = input().split()
	if int(lst[1]) - int(lst[0]) > 1:
		result += 1
print(result)


s = 0
for _ in range(int(input())):
	(a, b) = map(int, input().split())
	if b - a > 1:
		s += 1
print(s)


def main():
	ans = 0
	for _ in range(int(input())):
		(x, y) = map(int, input().split())
		if y - x >= 2:
			ans += 1
	print(ans)
	pass
main()


n = int(input())
l = [[int(i) for i in input().split()] for i in range(n)]
lst = l[:]
for i in range(n):
	if l[i][1] - l[i][0] < 2:
		lst.remove(l[i])
print(len(lst))


result = 0
rooms = int(input())
for i in range(rooms):
	(number_of_residents, capacity) = map(int, input().split())
	if capacity > number_of_residents and capacity - number_of_residents >= 2:
		result += 1
print(result)


n = int(input())
count = 0
for i in range(n):
	pq = list(input().split())
	p = int(pq[0])
	q = int(pq[1])
	if q - p >= 2:
		count += 1
print(count)


n = int(input())
k = 0
for i in range(n):
	(a, b) = map(int, input().split())
	if b - a >= 2:
		k += 1
	else:
		continue
print(k)


a = int(input())
count = 0
while a != 0:
	(p, q) = map(int, input().split())
	if p + 2 <= q:
		count += 1
	a -= 1
print(count)


t = int(input())
cnt = 0
for i in range(t):
	(a, b) = map(int, input().split())
	if b - a >= 2:
		cnt += 1
print(cnt)


test_cases = int(input())
count = 0
for i in range(test_cases):
	hostel = list(map(int, input().split(' ')))
	if abs(hostel[1] - hostel[0]) > 1:
		count += 1
print(count)


num = int(input())
ans = 0
for i in range(num):
	(a, b) = map(int, input().split())
	if b - a >= 2:
		ans += 1
print(ans)


number_of_rooms = int(input())
output = 0
for i in range(number_of_rooms):
	(p, q) = [int(i) for i in input().split()]
	if q - p >= 2:
		output += 1
print(output)


n = int(input())
room = 0
for i in range(n):
	(p, q) = list(map(int, input().split()))
	if p < q - 1:
		room += 1
print(room)


n = int(input())
cont = 0
while n != 0:
	data = list(map(int, input().split()))
	if data[1] - data[0] >= 2:
		cont += 1
	n -= 1
print(cont)


n = int(input())
rooms = 0
for i in range(n):
	(q, i) = map(int, input().split())
	rooms += i - q >= 2
print(rooms)


a = int(input())
s = 0
for i in range(0, a):
	list = input().split()
	if int(list[0]) + 1 < int(list[1]):
		s += 1
print(s)


n = int(input())
cnt = 0
while n > 0:
	people = list(map(int, input().split()))
	if people[0] + 2 <= people[1]:
		cnt += 1
	else:
		pass
	n -= 1
print(cnt)


count = 0
for i in range(int(input())):
	a = list(map(int, input().split()))
	a = abs(a[0] - a[1])
	if a > 1:
		count = count + 1
print(count)


a = int(input())
count = 0
for i in range(a):
	c = input()
	d = c.split()
	m = int(d[0])
	n = int(d[1])
	if n - m >= 2:
		count += 1
print(count)


n = int(input())
arr = []
for i in range(n):
	arr.append(input().split())
cont = 0
for i in arr:
	if int(i[1]) - int(i[0]) >= 2:
		cont += 1
print(cont)


num_rooms = int(input())
livable_rooms = 0
for i in range(num_rooms):
	(people, capacity) = input().split()
	people = int(people)
	capacity = int(capacity)
	if capacity - people >= 2:
		livable_rooms += 1
print(livable_rooms)


n = int(input())
sum = 0
arr = []
for i in range(n):
	arr = list(map(int, input().split()))
	if arr[1] - arr[0] >= 2:
		sum = sum + 1
	arr.pop()
print(sum)


n = int(input())
p = [None] * n
q = [None] * n
count = 0
for i in range(0, n):
	a = input()
	p[i] = a.split()[0]
	q[i] = a.split()[1]
	if int(q[i]) - int(p[i]) >= 2:
		count += 1
print(count)


from sys import stdin

def readInts():
	return map(int, stdin.readline().strip().split())

def solve(vs):
	return None

def run():
	(n,) = readInts()
	out = 0
	for _ in range(n):
		(p, q) = readInts()
		if q - p >= 2:
			out += 1
	print(out)
run()


n = int(input())
z = 0
for _ in range(n):
	(a, b) = map(int, input().split())
	if b - a >= 2:
		z += 1
	else:
		z += 0
print(z)


n = int(input())
ans = 0
for i in range(n):
	x = list(map(int, input().split()))
	if x[1] - x[0] > 1:
		ans += 1
print(ans)


def solve():
	n = int(input())
	ret = 0
	for i in range(n):
		r = input().split(' ')
		if int(r[1]) - int(r[0]) >= 2:
			ret += 1
	print(ret)
solve()


cnt = 0
for i in [0] * int(input()):
	a = input().split()
	cnt += int(a[1]) - int(a[0]) >= 2
print(cnt)


x = int(input())
z = 0
for i in range(x):
	(p, q) = map(int, input().split())
	if q - p >= 2:
		z += 1
print(z)


t = int(input())
i = 1
count = 0
while i <= t:
	(p, q) = map(int, input().split())
	if p < q - 1:
		count = count + 1
	i = i + 1
print(count)


def george_and_accomodation():
	n_rooms = int(input())
	n_free_rooms = 0
	for _ in range(0, n_rooms):
		(occupation, capacity) = input().split()
		occupation = int(occupation)
		capacity = int(capacity)
		if capacity - occupation >= 2:
			n_free_rooms += 1
	print(n_free_rooms)
george_and_accomodation()


n = int(input())
count = 0
for room in range(n):
	(p, q) = [int(item) for item in input().split(' ')]
	if q >= p + 2:
		count += 1
print(count)


n = int(input())
x = []
for i in range(n):
	x.append(list(map(int, input().split())))
left = 0
count = 0
for i in x:
	if i[1] - i[0] >= 2:
		count += 1
print(count)


from sys import stdin

def main():
	n = stdin.readline().strip()
	SALIDA = []
	while len(n) != 0:
		rooms = []
		for i in range(int(n)):
			rooms.append(tuple([int(c) for c in stdin.readline().split()]))
		SALIDA.append(str(sum([1 for c in range(int(n)) if rooms[c][1] - rooms[c][0] >= 2])))
		n = stdin.readline().strip()
	print('\n'.join(SALIDA))
main()


n = int(input())
out = 0
for _ in range(n):
	(p, q) = [int(x) for x in input().split()]
	if q - p >= 2:
		out += 1
print(out)


counter = 0
for i in range(int(input())):
	(live_now, room_capacity) = map(int, input().split())
	if room_capacity - live_now >= 2:
		counter += 1
print(counter)


rooms_available = 0
num = int(input())
pq = []
for i in range(num):
	s = input()
	pq.append(s.split())
for p in pq:
	if int(p[1]) - int(p[0]) >= 2:
		rooms_available += 1
print(rooms_available)


n = int(input())
x = []
y = []
c = 0
for i in range(n):
	(a, b) = map(int, input().split())
	x.append(a)
	y.append(b)
for j in range(len(x)):
	if y[j] - x[j] >= 2:
		c = c + 1
	else:
		c = c + 0
print(c)


n = int(input())
l = [input() for i in range(n)]
br = 0
for i in l:
	a = i.split()
	n = int(a[1]) - int(a[0])
	if n >= 2:
		br += 1
print(br)


s = int(input())
o = 0
for i in range(s):
	k = [int(x) for x in input().split()]
	if k[1] - k[0] >= 2:
		o += 1
print(o)


a = int(input())
s = 0
for i in range(a):
	(d, f) = map(int, input().split())
	if f - d >= 2:
		s += 1
print(s)


t = int(input())
ans = 0
for i in range(0, t):
	room = input().split()
	if int(room[1]) - int(room[0]) >= 2:
		ans += 1
print(ans)


t = int(input())
cn = 0
for _ in range(t):
	(a, b) = map(int, input().rstrip().split())
	if b - a >= 2:
		cn += 1
print(cn)


n = int(input())
room = 0
for i in range(n):
	(a, b) = input().split()
	(a, b) = (int(a), int(b))
	if a < b and b - a >= 2:
		room += 1
print(room)


n = int(input())
x = []
z = []
d = 0
for i in range(n):
	y = list(map(int, input().split()))
	x.append(y)
for i in range(n):
	for j in range(1):
		z.append(abs(x[i][j] - x[i][j + 1]))
for i in range(len(z)):
	if z[i] >= 2:
		d = d + 1
print(d)


n = int(input())
s = []
for i in range(n):
	(p, q) = map(int, input().split())
	s += [q - p > 1]
print(sum(s))


dl = int(input())
arr = []
for i in range(0, dl):
	arr.append(list(input().split()))
chet = 0
for i in range(0, len(arr)):
	if int(int(arr[i][1]) - int(arr[i][0]) >= 2):
		chet += 1
print(chet)


c = 0
for i in range(int(input())):
	(p, q) = list(map(int, input().split()))
	if abs(p - q) > 1:
		c += 1
print(c)


U = 0
n = int(input())
for i in range(0, n):
	p = input().rstrip().split(' ')
	a = int(p[0])
	b = int(p[1])
	if b >= a and b - a >= 2:
		U += 1
print(U)


count = 0
for i in range(int(input())):
	if abs(eval(input().replace(' ', '-'))) >= 2:
		count += 1
print(count)


n = int(input())
count = 0
for i in range(n):
	inp1 = str(input())
	inp = inp1.split()
	a = int(inp[0])
	b = int(inp[1])
	if b - a >= 2:
		count += 1
print(count)


amt = int(input())
rooms = 0
for i in range(amt):
	r = input().split(' ')
	living = int(r[0])
	available = int(r[1])
	if available - living >= 2:
		rooms += 1
print(rooms)


n = int(input())
x = 0
for i in range(n):
	r = tuple(input().split())
	if int(r[1]) - int(r[0]) >= 2:
		x += 1
print(x)


ct = 0
for _ in range(int(input())):
	(a, b) = list(map(int, input().split()))
	if b - a >= 2:
		ct += 1
print(ct)


count = 0
for _ in range(int(input())):
	(p, q) = [int(x) for x in input().split()]
	if abs(p - q) >= 2:
		count += 1
print(count)


nums = input().split(' ')
nums = int(nums[0])
sums = 0
for i in range(nums):
	k = input().split(' ')
	k = [int(k[i]) for i in range(len(k))]
	if k[1] - k[0] >= 2:
		sums += 1
	else:
		sums += 0
print(sums)


n = input()
n = int(n)
x = 0
i = 1
while i <= n:
	(a, b) = input().split()
	(a, b) = (int(a), int(b))
	if b - a >= 2:
		x = x + 1
	i = i + 1
print(x)


t = int(input())
cnt = 0
for cases in range(t):
	(a, b) = map(int, input().split())
	if b - a > 1:
		cnt += 1
print(cnt)


import sys
n = int(input())
count = 0
for i in range(n):
	inputs = sys.stdin.readline().split()
	a = int(inputs[0])
	b = int(inputs[1])
	c = b - a
	if c > 1:
		count = count + 1
print(count)


n = input()
count = 0
for i in range(int(n)):
	room = input()
	room = list(map(lambda e: int(e), room.split(' ')))
	if room[1] - room[0] >= 2:
		count = count + 1
print(count)


c = 0
for i in range(int(input())):
	nm = input().split()
	n = int(nm[0])
	m = int(nm[1])
	if m - n >= 2:
		c += 1
print(c)


n = int(input())
(P, Q) = ([], [])
for i in range(n):
	(p, q) = [int(c) for c in input().split()]
	P.append(p)
	Q.append(q)
ans = sum((1 for (p, q) in zip(P, Q) if q - p >= 2))
print(ans)


n = int(input())
available = 0
for _ in range(n):
	(i, j) = [int(a) for a in input().strip().split()]
	if j - i >= 2:
		available += 1
print(available)


a = int(input())
counter = 0
for i in range(0, a):
	r = input()
	room = r.split()
	room = list(map(int, room))
	if room[1] - room[0] >= 2:
		counter += 1
print(counter)


n = int(input())
c = 0
while n != 0:
	a = input()
	a1 = list(a.split(' '))
	d = int(a1[1])
	b = int(a1[0])
	if d - b >= 2:
		c = c + 1
	n = n - 1
print(c)


room = int(input())
counter = 0
for i in range(room):
	status = input().rsplit()
	if int(status[1]) - int(status[0]) >= 2:
		counter -= -1
print(counter)


favourable = 0
for _ in range(int(input())):
	details = input().split()
	if int(details[1]) - int(details[0]) >= 2:
		favourable += 1
print(favourable)


test_case = int(input())
count = 0
while test_case:
	(people, capacity) = map(int, input().split())
	if capacity - people >= 2:
		count += 1
	test_case -= 1
print(count)


n = int(input())
counter = 0
for k in range(n):
	(p, q) = map(int, input().split())
	if p + 2 <= q:
		counter += 1
	else:
		counter += 0
print(counter)


n = int(input())
rooms = 0
for i in range(0, n):
	(has, able) = [int(x) for x in input().split()]
	if able - has >= 2:
		rooms += 1
print(rooms)


n = int(input())
s = []
for i in range(n):
	s.append(tuple(map(int, input().split())))
ha = 0
for i in range(n):
	if s[i][1] - s[i][0] >= 2:
		ha += 1
print(ha)


n = int(input())
cnt = 0
for i in range(n):
	(p, q) = map(int, str(input()).split(' '))
	if q - p >= 2:
		cnt += 1
print(cnt)


n = int(input())
l = []
sum = 0
for i in range(n):
	(p, q) = map(int, input().split())
	num = q - p
	l.append(num)
for x in range(len(l)):
	if l[x] >= 2:
		sum += 1
print(sum)


test = int(input())
res = 0
for i in range(test):
	dorm = input().split()
	if int(dorm[1]) - int(dorm[0]) >= 2:
		res += 1
print(res)


n = int(input())
r = 0
while n > 0:
	(a, b) = [int(j) for j in input().split()]
	r += 1 if b - a > 1 else 0
	n -= 1
print(r)


a = int(input().strip())
c = []
s = 0
for i in range(a):
	b = []
	b = [int(x) for x in input().split()]
	c.append(b)
for i in c:
	if abs(i[0] - i[1]) >= 2:
		s += 1
print(s)


n = int(input())
counter = 0
for i in range(n):
	temp = input().split(' ')
	a = int(temp[0])
	b = int(temp[1])
	free = b - a
	if free >= 2:
		counter += 1
print(counter)


n = int(input())
a = []
for i in range(n):
	a.append(input())
b = []
for i in range(n):
	b.append(list(a[i].split()))
k = 0
for i in range(n):
	if int(b[i][1]) - int(b[i][0]) >= 2:
		k = k + 1
	else:
		k = k
print(k)


n = int(input())
Zh = []
for i in range(n):
	Zh.append(input().split())
for i in range(len(Zh)):
	for j in range(2):
		Zh[i][j] = int(Zh[i][j])
k = 0
for i in range(len(Zh)):
	if Zh[i][1] - Zh[i][0] >= 2:
		k = k + 1
print(k)


n = int(input())
rooms = [[j for j in map(int, input().split())] for i in range(n)]
ans = 0
for i in range(n):
	if rooms[i][1] - rooms[i][0] >= 2:
		ans += 1
print(ans)


acc = 0
n = int(input())
for i in range(n):
	l = input().split()
	b = eval(l[1] + '-' + l[0])
	if b >= 2:
		acc += 1
print(acc)


a = int(input())
S = 0
for i in range(a):
	(b, c) = map(int, input().split())
	S += max((c - b > 1, 0))
print(S)


n = int(input())
c = 0
for i in range(n):
	(occ, cpa) = map(int, input().strip().split())
	if occ != cpa and occ <= cpa - 2:
		c += 1
print(c)


c = 0
n = int(input())
for i in range(n):
	s = input()
	l = s.split()
	p = int(l[0])
	q = int(l[1])
	if q - p >= 2:
		c = c + 1
print(c)


from sys import stdin, stdout
inp = stdin.readline
out = stdout.write
n = int(inp().strip())
c = 0
for i in range(n):
	(p, q) = map(int, inp().strip().split())
	if q - p >= 2:
		c += 1
out(str(c))


num = int(input())
i = 0
output = 0
dorm = []
while i < num:
	li = list(map(int, input().split()))
	dorm.append(li)
	i = i + 1
for li in dorm:
	delta = li[1] - li[0]
	if delta >= 2:
		output = output + 1
print(output)


n = int(input())
ls = []
co = 0
for _ in range(n):
	ls.append(list(map(int, input().rstrip().split())))
for lis in ls:
	if lis[1] - lis[0] >= 2:
		co += 1
print(co)


counter = 0
for i in range(int(input())):
	(p, q) = input().split()
	counter += 1 if int(q) - int(p) >= 2 else 0
print(counter)


counter = 0
n = int(input())
while n > 0:
	n -= 1
	temp = input()
	p = int(temp.split(' ')[0])
	q = int(temp.split(' ')[1])
	if q - p >= 2:
		counter += 1
print(counter)


import sys
from copy import copy
n = int(input())
t = 0
for _ in range(n):
	(p, q) = map(int, input().split())
	if q - p >= 2:
		t += 1
print(t)


n = int(input())
move = 0
for i in range(0, n):
	(total_members, capacity) = input().split()
	total_members = int(total_members)
	capacity = int(capacity)
	if 2 <= capacity - total_members:
		move = move + 1
print(move)


num_rooms = int(input())
room_list = []
available_rooms = 0
for i in range(0, num_rooms):
	passenger_values = [int(x) for x in input().split(' ')]
	room_list.append(passenger_values)
for rooms in room_list:
	if rooms[0] <= rooms[1] - 2:
		available_rooms += 1
print(available_rooms)


s = int(input())
c = 0
for i in range(0, s):
	i = input()
	str = i.split(' ')
	p = str[0]
	q = str[1]
	p = int(p) + 2
	if p <= int(q):
		c = c + 1
print(c)


n = int(input())
jml = 0
for i in range(n):
	data = input().split()
	if int(data[0]) + 2 <= int(data[1]):
		jml += 1
print(jml)


n = int(input())
i = 0
res = 0
while i < n:
	(x1, x2) = map(int, input().split(' '))
	if x2 - x1 > 1:
		res += 1
	i += 1
print(res)


lisa = input()
lisa = int(lisa)
jin = [''] * lisa
for i in range(lisa):
	jin[i] = input()
	jin[i] = jin[i].split()
rooms = 0
for i in range(lisa):
	if int(jin[i][1]) - int(jin[i][0]) >= 2:
		rooms += 1
print(rooms)


n = int(input())
m = 0
for i in range(n):
	numm = [int(x) for x in input().split()]
	people = numm[1] - numm[0]
	if people >= 2:
		m += 1
print(m)


t = int(input())
count = 0
for it in range(t):
	(a, b) = map(int, input().split())
	if b - a >= 2:
		count += 1
print(count)


n = int(input())
cnt = 0
while n:
	(p, q) = map(int, input().split())
	cnt += q - p >= 2
	n -= 1
print(cnt)


n = int(input())
s = 0
for i in range(n):
	k = input().split()
	pi = int(k[0])
	qi = int(k[1])
	if qi - pi >= 2:
		s += 1
print(s)


rooms = []
free_rooms = 0
for _ in range(int(input())):
	rooms.append([int(i) for i in input().split()])
for r in rooms:
	if r[0] + 2 <= r[1]:
		free_rooms += 1
print(free_rooms)


n = int(input())
value = 0
for i in range(n):
	str1 = input()
	space = str1.find(' ')
	if int(str1[0:space]) + 2 <= int(str1[space:]):
		value += 1
print(value)


import math
n = int(input())
a = []
result = 0
for i in range(n):
	a.append(list(map(int, input().split())))
for i in range(len(a)):
	if abs(a[i][0] - a[i][1]) <= 1:
		continue
	else:
		result += 1
print(result)


x = input()
sum = 0
for i in range(int(x)):
	room = input().split()
	if int(room[0]) < int(room[1]) and int(room[0]) + 2 <= int(room[1]):
		sum = sum + 1
print(sum)


n = int(input())
m = n
i = 0
while i < n:
	l = input()
	li = l.split(' ')
	i += 1
	if int(li[1]) - int(li[0]) < 2:
		m -= 1
print(m)


n = int(input())
c = 0
d = 0
for i in range(n):
	(p, q) = input().split()
	p = int(p)
	q = int(q)
	if p == q or q - p == 1:
		d = 0
	else:
		c = c + 1
print(c + d)


n = int(input())
t = 0
for _ in range(n):
	(a, b) = map(int, input().split())
	t += a < b - 1
print(t)


from sys import stdin

def fun(lines):
	rooms = 0
	for line in lines[1:]:
		[a, b] = list(map(int, line.split(' ')))
		if b - a >= 2:
			rooms += 1
	return str(rooms)
tests = [['3\n1 1\n2 2\n3 3', '0'], ['3\n1 10\n0 10\n10 10', '2']]
print(fun(stdin.readlines()))


nRooms = int(input())
n = 0
for i in range(nRooms):
	actual = str(input()).split(' ')
	if int(actual[1]) - int(actual[0]) >= 2:
		n += 1
print(n)


n = int(input())
i = 0
tot = 0
while i < n:
	(p, q) = input().split()
	p = int(p)
	q = int(q)
	x = q - p
	if x >= 2:
		tot += 1
	i += 1
print(tot)


t = int(input())
s = 0
while t > 0:
	li = [int(x) for x in input().split()]
	if abs(li[0] - li[1]) >= 2:
		s = s + 1
	t = t - 1
print(s)


x = eval(input())
c = 0
i = 0
while i < x:
	y = list(map(int, input().split()))
	if y[0] + 2 <= y[1]:
		c += 1
	i += 1
print(c)


n = int(input())
counter = 0
for i in range(n):
	inp = str(input()).split()
	p = int(inp[0])
	q = int(inp[1])
	if q - p >= 2:
		counter += 1
print(counter)


def check(a, b):
	c = 0
	if b - a >= 2:
		c += 1
	else:
		c = 0
	return c
n = int(input())
l = []
while n > 0:
	n -= 1
	(a, b) = map(int, input().split())
	c = check(a, b)
	l.append(c)
print(sum(l))


(s, n, f) = (0, int(input()), lambda a: 1 if a[1] - a[0] > 1 else 0)
for i in range(n):
	s += f(tuple(map(int, input().split())))
print(s)


count = 0
nums = int(input())
for i in range(nums):
	(a, b) = map(int, input().split(' '))
	if b - a >= 2:
		count += 1
print(count)


cases = int(input())
totalPos = 0
for x in [1] * cases:
	(curr, total) = list(map(int, input().split()))
	totalPos += 1 if total - curr > 1 else 0
print(totalPos)


n = int(input())
l = list()
sl = list(range(2))
for i in range(n):
	sl = list(map(int, input().split()))
	l.insert(i, sl)
count = 0
for i in range(len(l)):
	p = l[i][0]
	q = l[i][1]
	diff = q - p
	if diff > 2 or diff == 2:
		count += 1
	diff = 0
print(count)


n = int(input())
a = 0
for i in range(n):
	(p, c) = map(int, input().split())
	if c - p >= 2:
		a += 1
	else:
		pass
print(a)


a = int(input())
x = 0
for i in range(a):
	sd = input()
	if int(sd.split()[0]) < int(sd.split()[1]):
		if int(sd.split()[0]) - int(sd.split()[1]) <= -2:
			x += 1
print(x)


tot = int(input())
say = 0
for _ in range(tot):
	(f, t) = map(int, input().split())
	if f + 2 <= t:
		say += 1
print(say)


r = 0
for _ in range(int(input())):
	(n, m) = map(int, input().split())
	r += int(n <= m - 2)
print(r)


n = int(input())
ans = 0
for i in range(n):
	(p, q) = [int(x) for x in input().split()]
	if q - p > 1:
		ans += 1
print(ans)


n = int(input())
room = 0
while n > 0:
	bed = input().split()
	bed = list(map(int, bed))
	if bed[1] - bed[0] >= 2:
		room = room + 1
	n = n - 1
print(room)


def main():
	n = int(input())
	s = 0
	for i in range(n):
		(current, possible) = map(int, input().split())
		if possible - current >= 2:
			s += 1
	print(s)
main()


n = int(input())
p = []
for i in range(n):
	p += [list(map(int, input().split()))]
print(sum([i[1] - i[0] > 1 for i in p]))


n = int(input())
c = 0
while n > 0:
	(m, p) = map(int, input().split())
	if abs(p - m) >= 2:
		c += 1
	n -= 1
print(c)


def getlist(tcast):
	return [tcast(x) for x in input().strip().split(' ')]

def getvar(tcast):
	return tcast(input().strip())
nrooms = getvar(int)
total = 0
for r in range(nrooms):
	(has, limit) = getlist(int)
	total += 1 if limit - has >= 2 else 0
print(total)


n = int(input())
c = 0
for i in range(n):
	(j, k) = map(int, input().split())
	if k - j >= 2:
		c += 1
print(c)


n = int(input())
l = []
c = 0
s = []
for i in range(n):
	a = list(map(int, input().split()))
	l.append(a)
for i in range(n):
	s = l[i]
	for j in range(2):
		try:
			if s[j + 1] - s[j] >= 2:
				c += 1
		except:
			pass
print(c)


import math as mt
import sys as sy

class abc:

	def mkl(self):
		n = int(sy.stdin.readline())
		c = 0
		for _ in range(n):
			(pi, qi) = map(int, sy.stdin.readline().split())
			if abs(pi <= qi and pi - qi) >= 2:
				c = c + 1
		print(c)
b = abc()
b.mkl()


no_of_rooms = int(input())
count = 0
for i in range(no_of_rooms):
	(p, q) = map(int, input().split(' '))
	if q - p >= 2:
		count += 1
	else:
		pass
print(count)


times = int(input())
ans = 0
for _ in range(times):
	vals = list(map(int, input().split()))
	if vals[1] - vals[0] >= 2:
		ans += 1
print(ans)


n = int(input())
s = 0
while n > 0:
	inp = list(map(int, input().split()))
	if abs(inp[0] - inp[1]) > 1:
		s += 1
	n -= 1
print(s)


test = int(input())
count = 0
for t in range(test):
	(n, cap) = map(int, input().split())
	if cap - n >= 2:
		count += 1
print(count)


n = int(input())
sum = 0
for i in range(n):
	(now, maximum) = map(int, input().split())
	if maximum - now >= 2:
		sum += 1
print(sum)


n = int(input())
a = [list(map(int, input().split())) for i in range(n)]
res = 0
ans = []
summa = 0
for i in range(len(a)):
	for j in range(len(a[i]) - 1):
		res = a[i][1] - a[i][0]
		ans.append(res)
		res = 0
for z in range(len(ans)):
	if ans[z] >= 2:
		summa += 1
print(summa)


good_rooms = 0
for i in range(int(input())):
	(x, y) = [int(x) for x in input().split()]
	if y - x > 1:
		good_rooms += 1
print(good_rooms)


n = int(input())
lst = []
lst1 = []
i = 0
j = 0
while i < n:
	lst.append(input())
	i += 1
while j < n:
	if int(lst[j].split()[1]) - int(lst[j].split()[0]) >= 2:
		lst1.append(1)
		j += 1
	else:
		j += 1
print(len(lst1))


import sys

def get():
	return int(sys.stdin.readline().strip())

def geti():
	return map(int, sys.stdin.readline().strip().split())
c = 0
for _ in range(get()):
	(p, q) = geti()
	if q - p > 1:
		c += 1
print(c)


n = int(input())
arr = []
for i in range(n):
	(p, q) = map(int, input().split())
	arr.append([p, q])
counter = 0
for k in arr:
	if k[1] - k[0] > 1:
		counter += 1
print(counter)


testCase = int(input())
count = 0
while testCase > 0:
	(a, b) = input().split()
	a = int(a)
	b = int(b)
	if b - a >= 2:
		count += 1
	testCase -= 1
print(count)


input_s = int(input())
mount = 0
for i in range(input_s):
	input_l = input().split(' ')
	if int(input_l[1]) - int(input_l[0]) >= 2:
		mount += 1
print(mount)


n = int(input())
rooms = 0
for i in range(n):
	(p, q) = [int(element) for element in input().split(' ')]
	if q - p >= 2:
		rooms += 1
print(rooms)


(n, count, res) = (int(input()), 0, [])
for i in range(n):
	res.append([int(i) for i in input().split()])
for i in res:
	if i[1] - i[0] >= 2:
		count += 1
print(count)


n = int(input())
c = []
for i in range(n):
	(a, b) = [int(x) for x in input().split()]
	d = b - a
	c.append(d)
count = 0
for i in range(len(c)):
	if c[i] >= 2:
		count += 1
print(count)


number_of_rooms = int(input())
available_rooms = 0
for _unk in range(number_of_rooms):
	(people_living, open_areas) = [int(x) for x in input().split(' ')]
	if open_areas - people_living >= 2:
		available_rooms += 1
print(available_rooms)


n = int(input())
m = 0
for i in range(n):
	s = [int(x) for x in input().split()]
	if s[0] + 1 < s[1]:
		m += 1
print(m)


n = int(input())
cnt = 0
for i in range(n):
	tmp = list(map(int, input().split()))
	cnt += 1 if tmp[1] - tmp[0] > 1 else 0
print(cnt)


n = int(input())
res = 0
for i in range(n):
	(p, q) = [int(el) for el in input().split(' ')]
	res += q - p >= 2
print(res)


n = int(input())
(s, k) = (0, 0)
while k < n:
	(q, p) = [int(i) for i in input().split()]
	if p - q >= 2:
		s += 1
	k += 1
print(s)


n = int(input())
t = 0
i = 0
while i < n:
	(l, m) = map(int, input().split())
	if m - l >= 2:
		t += 1
	i += 1
print(t)


x = int(input())
f = 0
for i in range(x):
	(a, b) = map(int, input().split(' '))
	if b - a > 1:
		f = f + 1
print(f)


testcases = int(input())
count = 0
for i in range(testcases):
	(pi, qi) = map(int, input().split(' '))
	if qi - pi > 1:
		count = count + 1
print(count)


def main():
	rooms = 0
	n = int(input())
	for _ in range(n):
		(p, q) = input().split()
		p = int(p)
		q = int(q)
		rooms += 1 if q - p >= 2 else 0
	print(rooms)
main()


n = int(input())
f = 0
for i in range(n):
	(k, m) = map(int, input().split())
	if k + 1 < m:
		f += 1
print(f)


n = int(input())
fill = []
cap = []
for _ in range(n):
	(p, q) = list(map(int, input().split()))
	fill.append(p)
	cap.append(q)
ans = 0
for i in range(n):
	if cap[i] - fill[i] >= 2:
		ans += 1
print(ans)


s = 0
a = int(input())
T = []
for i in range(a):
	T.append(input())
for i in range(a):
	(c, b) = (int(i) for i in T[i].split())
	if b - c >= 2:
		s += 1
print(s)


a = int(input())
count = 0
for i in range(0, a):
	list1 = input().split(' ')
	livingpeople = int(list1[0])
	limitpeople = int(list1[1])
	if limitpeople - livingpeople >= 2:
		count += 1
print(count)


number = int(input())
count = 0
for noneed in range(number):
	(inp1, inp2) = input().split(' ')
	inp1 = int(inp1)
	inp2 = int(inp2)
	if inp2 - inp1 >= 2:
		count += 1
print(count)


ruang = int(input())
capacity = list()
for i in range(ruang):
	capacity.append([int(i) for i in input().split()])
count = 0
for i in capacity:
	if i[1] - i[0] >= 2:
		count += 1
print(count)


n = int(input())
count = 0
for i in range(0, n):
	listAcc = [int(x) for x in input().split(' ')]
	d = listAcc[1] - listAcc[0]
	if d >= 2:
		count += 1
print(count)


n = int(input())
l = []
for i in range(n):
	m = list(map(int, input().split()))
	l.append(m)
s = 0
for i in range(len(l)):
	if l[i][1] - l[i][0] >= 2:
		s += 1
print(s)


n = int(input())
ans = 0
for i in range(n):
	p = [int(j) for j in input().split()]
	ans += 1 if p[1] - p[0] >= 2 else 0
print(ans)


bleh = int(input())
c = 0
for i in range(bleh):
	(a, b) = map(int, input().split())
	k = b - a
	if k > 2 or k == 2:
		c = c + 1
print(c)


k = 0
n = int(input())
for i in range(n):
	e = list(map(lambda x: int(x), input().split()))
	if int(e[1]) - int(e[0]) >= 2:
		k += 1
print(k)


n = int(input())
count = 0
for counting in range(0, n):
	p_q = input().split(' ')
	p = int(p_q[0])
	q = int(p_q[1])
	if q - p >= 2:
		count += 1
print(count)


n = int(input())
room_caps = [[int(x) for x in input().split(' ')] for i in range(n)]
movable_nums = 0
for caps in room_caps:
	if caps[1] - caps[0] >= 2:
		movable_nums += 1
print(movable_nums)


n = int(input())
rd = [0] * n
for x in range(0, n):
	rd[x] = [int(x) for x in input().split(' ')]
count = 0
for x in range(0, n):
	if rd[x][1] >= rd[x][0] + 2:
		count += 1
print(count)


n = int(input())
answer = 0
for i in range(n):
	sit = input().split()
	if int(sit[1]) - int(sit[0]) >= 2:
		answer = answer + 1
print(str(answer))


n = int(input())
p = []
q = []
for _ in range(n):
	(a, b) = map(int, input().split())
	p.append(a)
	q.append(b)
ans = 0
for i in range(n):
	if q[i] - p[i] >= 2:
		ans += 1
print(ans)


room = int(input())
ans = 0
for i in range(room):
	(p, q) = (int(v) for v in input().split())
	if q - p >= 2:
		ans += 1
print(ans)


n = int(input())
lst1 = list()
for i in range(n):
	lst1.append(input())
s = 0
for i in range(n):
	str1 = lst1[i].split()
	if int(str1[0]) + 1 < int(str1[1]):
		s = s + 1
print(s)


n = int(input())
print(len(list(filter(lambda x: x[1] - x[0] >= 2, [list(map(int, input().split())) for i in range(n)]))))


def vacant_room(n):
	count = 0
	for i in range(0, n):
		(p, q) = map(int, input().strip().split(' '))
		if q - p > 1:
			count += 1
	return count
n = int(input())
print(vacant_room(n))


l = []
for i in range(int(input())):
	(p, q) = map(int, input().split())
	c = 0
	if q - p >= 2:
		c += 1
		l.append(c)
print(sum(l))


def Q19(lis):
	count = 0
	for i in lis:
		if i[1] - i[0] >= 2:
			count += 1
	return count
lis = []
n = int(input())
for i in range(n):
	line = input().strip()
	values = list(map(int, line.split()))
	lis.append(values)
print(Q19(lis))


t = int(input())
c = 0
while t > 0:
	st = input().split()
	p = int(st[0])
	q = int(st[1])
	if q - p > 1:
		c += 1
	t -= 1
print(c)


ans = 0
for i in range(int(input())):
	(a, b) = [int(k) for k in input().split()]
	if a + 2 <= b:
		ans += 1
print(ans)


n = int(input())
room = 0
for i in range(n):
	k = input().split()
	freeplace = int(k[1]) - int(k[0]) - 2
	if freeplace >= 0:
		room += 1
print(room)


def kol_sv_kom(n):
	k = 0
	for i in range(n):
		(a, b) = map(int, input().split())
		if b - a > 1:
			k += 1
	return k
print(kol_sv_kom(int(input())))


n = int(input())
i = 0
k = 0
while i < n:
	(a, b) = map(int, input().split())
	if b - a > 1:
		k += 1
	i += 1
print(k)


print(sum([1 for (a, b) in [list(map(int, input().split())) for _ in range(int(input()))] if b - a > 1]))


t = int(input())
c = 0
for i in range(t):
	(x, y) = map(int, input().split())
	d = y - x
	if d >= 2:
		c += 1
print(c)


import math
g = lambda x: map(x, input().split())
n = int(input())
cnt = 0
for i in range(n):
	(p, q) = g(int)
	cnt += int(q - p >= 2)
print(cnt)


a = int(input())
p = []
for i in range(a):
	l = input().split()
	p.append(l)
s = 0
for j in range(a):
	if int(p[j][1]) - int(p[j][0]) >= 2:
		s = s + 1
print(s)


from sys import stdin, stdout, exit as sys_ret
(f_input, f_print, f_flush) = (stdin.readline, stdout.write, stdout.flush)
count = 0
for i in range(int(f_input())):
	(already, capacity) = map(int, f_input().split())
	if already + 2 <= capacity:
		count += 1
f_print(str(count))


from sys import *
from math import *

def main():
	n = int(input())
	c = 0
	for i in range(n):
		(p, q) = [int(x) for x in input().split()]
		if p + 2 <= q:
			c += 1
	print(c)
main()


print(sum((next(m) + 2 <= next(m) for m in (map(int, input().split()) for i in range(int(input()))))))


size = int(input())
count = 0
for i in range(size):
	(num1, num2) = input().split()
	if int(num1) != int(num2) and abs(int(num1) - int(num2)) > 1:
		count = count + 1
print(count)


a = int(input())
res = 0
for _ in range(a):
	(x, y) = [int(i) for i in input().split()]
	if x + 2 <= y:
		res += 1
print(res)


n = int(input())
c = 0
for asdf in range(n):
	line = input().split()
	if int(line[1]) - int(line[0]) >= 2:
		c += 1
print(c)


n = int(input())
counter = 0
for nol in range(n):
	(p, q) = map(int, input().split())
	c = q - p
	if c > 1:
		counter += 1
print(counter)


c = 0
for _ in range(int(input())):
	(p, q) = tuple(map(int, input().strip(' ').split(' ')))
	if p <= q and q - p >= 2:
		c += 1
print(c)


def george():
	x = int(input())
	count = 0
	for _ in range(x):
		(a, b) = map(int, input().split())
		if b - a >= 2:
			count += 1
	print(count)
george()


times = int(input())
count = 0
for i in range(times):
	(x, y) = map(int, input().split())
	if x + 2 <= y:
		count = count + 1
print(count)


sum = 0
for _ in range(int(input())):
	(x, y) = map(int, input().split())
	if y > x + 1:
		sum += 1
print(sum)


r = 0
for i in range(int(input(''))):
	pq = input('').split(' ')
	(p, q) = (int(pq[0]), int(pq[1]))
	if q - p >= 2:
		r += 1
print(r)


rooms = int(input())
result = 0
while rooms > 0:
	(people, maximum) = map(int, input().split())
	if maximum - people >= 2:
		result = result + 1
	rooms = rooms - 1
print(result)


n = int(input())
room_capacity = []
room_tenants = []
for i in range(n):
	(a, b) = map(int, input().split())
	room_tenants.append(a)
	room_capacity.append(b)
count = 0
for j in range(n):
	if room_tenants[j] + 2 <= room_capacity[j]:
		count += 1
print(count)


num = int(input())
count = 0
for i in range(num):
	(x, y) = [int(x) for x in input().split(' ')]
	if y - x >= 2:
		count += 1
print(count)


x = int(input())
y = []
a = 0
for i in range(x):
	y.append(list(map(int, input().split(' '))))
for i in range(x):
	if y[i][1] - y[i][0] >= 2:
		a += 1
	else:
		pass
print(a)


n = int(input())
A = [list(map(int, input().split())) for _ in range(n)]
r = 0
for k in range(n):
	if A[k][1] - A[k][0] >= 2:
		r += 1
print(r)


n = int(input())
res = 0
for room in range(n):
	(p, q) = input().split()
	p = int(p)
	q = int(q)
	if p < q - 1:
		res = res + 1
print(res)


n = int(input())
total = 0
for i in range(n):
	x = input().split()
	if int(x[1]) - int(x[0]) > 1:
		total += 1
print(total)


numberOfRooms = int(input())
numberOfRoomsValid = 0
for i in range(numberOfRooms):
	(occupancy, capacity) = [int(ip) for ip in input().split(' ')]
	if capacity - occupancy >= 2:
		numberOfRoomsValid = numberOfRoomsValid + 1
print(numberOfRoomsValid)


import sys
n = int(sys.stdin.readline())
k = 0
for i in range(0, n):
	p = sys.stdin.readline().strip().split(' ')
	if int(p[0]) + 2 <= int(p[1]):
		k = k + 1
print(k)


n = int(input())
count = 0
for i in range(n):
	(a, b) = input().split()
	j = 0
	while j > 1 or j == 0:
		j -= 1
		if int(b) - int(a) > 1:
			count += 1
print(count)


n = int(input())
rooms = 0
for i in range(n):
	rooms += eval(input().replace(' ', '-')) <= -2
print(rooms)


n = int(input())
rooms = 0
for _ in range(n):
	(p, q) = input().split()
	(p, q) = (int(p), int(q))
	if q - p >= 2:
		rooms += 1
print(rooms)


n = int(input())
o = 0
for i in range(1, n + 1):
	z = tuple((int(j) for j in input().split()))
	if z[1] - z[0] > 1:
		o = o + 1
print(o)


n = int(input().strip('\n\r\t '))
c = 0
for i in range(0, n):
	line = input().strip('\n\r\t ')
	(q, p) = line.split(' ')
	q = int(q)
	p = int(p)
	if q + 2 <= p:
		c += 1
print(c)


from functools import reduce

def read_input():
	n = int(input())
	input_list = list()
	for index_loop in range(n):
		input_list.append([int(elem) for elem in input().split(' ')])
	return (n, input_list)

def resolve(capacity_list):
	count_possibilities = 0
	for dormitory in capacity_list:
		if reduce(lambda x, y: y - x, dormitory) >= 2:
			count_possibilities += 1
	return count_possibilities
(_, dormitory_capacity_list) = read_input()
print(resolve(dormitory_capacity_list))


n = int(input())
inp = lambda : map(int, input().split())
p = [None] * 101
q = [None] * 101
cnt = 0
for i in range(0, n):
	(p[i], q[i]) = inp()
for i in range(0, n):
	if q[i] - p[i] >= 2:
		cnt += 1
print(cnt)


a = int(input())
lis = []
for x in range(a):
	b = list(map(int, input().split()))
	p = b[1] - b[0]
	if p >= 2:
		lis.append(p)
print(len(lis))


a = int(input())
c = 0
for i in range(0, a):
	(M, N) = [int(x) for x in input().split()]
	if N - M >= 2:
		c = c + 1
print(c)


t = int(input())
ans = 0
for _ in range(t):
	(p, q) = list(map(int, input().split()))
	if q > p + 1:
		ans = ans + 1
print(ans)


c = 0
for u in range(int(input())):
	(x, y) = map(int, input().split())
	if y - x >= 2:
		c = c + 1
print(c)


n = int(input())
l = []
for i in range(n):
	(x, y) = map(int, input().split())
	l.append((x, y))
count = 0
for j in range(n):
	if l[j][1] - l[j][0] >= 2:
		count += 1
print(count)


n = int(input())
cnt = 0
for _ in range(n):
	ab = input().split()
	a = int(ab[0])
	b = int(ab[1])
	if b - a >= 2:
		cnt += 1
print(cnt)


n = int(input())
a = []
for i in range(n):
	x = list(map(int, input().split()))
	a.append(x)
k = []
t = 0
for i in range(len(a)):
	s = a[i][1] - a[i][0]
	k.append(s)
for i in range(len(k)):
	if k[i] > 1:
		t += 1
print(t)


import sys
import math
import bisect
from sys import stdin, stdout
from math import gcd, floor, sqrt, log
from collections import defaultdict as dd
from bisect import bisect_left as bl, bisect_right as br
sys.setrecursionlimit(100000000)
ii = lambda : int(input())
si = lambda : input()
jn = lambda x, l: x.join(map(str, l))
sl = lambda : list(map(str, input().strip()))
mi = lambda : map(int, input().split())
mif = lambda : map(float, input().split())
lii = lambda : list(map(int, input().split()))
ceil = lambda x: int(x) if x == int(x) else int(x) + 1
ceildiv = lambda x, d: x // d if x % d == 0 else x // d + 1
flush = lambda : stdout.flush()
stdstr = lambda : stdin.readline()
stdint = lambda : int(stdin.readline())
stdpr = lambda x: stdout.write(str(x))
mod = 1000000007
n = ii()
count = 0
for i in range(n):
	(p, q) = mi()
	if q - p >= 2:
		count += 1
print(count)


n = int(input())
cnt = 0
while n > 0:
	(a, b) = map(int, input().split())
	if a < b and abs(a - b) > 1:
		cnt += 1
	n -= 1
print(cnt)


n = int(input())
roomn = 0
for i in range(n):
	rooms = input()
	rooms = rooms.split(' ')
	if int(rooms[0]) <= int(rooms[1]) - 2:
		roomn += 1
print(roomn)


n = int(input())
a = []
for i in range(n):
	a.append([int(j) for j in input().split()])
t = 0
for i in a:
	s = i[1] - i[0]
	if s >= 2:
		t = t + 1
print(t)


a = int(input())
count = 0
for t in range(a):
	y = list(map(int, input().split(' ')))
	if y[0] + 1 < y[1]:
		count += 1
print(count)


n = int(input())
x = 0
for i in range(n):
	y = input()
	if int(y[y.index(' '):]) - int(y[:y.index(' ')]) >= 2:
		x += 1
print(x)


n = int(input())
b = 0
while n != 0:
	(p, q) = tuple((int(i) for i in input().strip().split(' ')))
	if q - p >= 2:
		b += 1
	n -= 1
print(b)


count = 0
n = int(input())
for row in range(n):
	(a, b) = map(int, input().split(' '))
	if b - a >= 2:
		count += 1
print(count)


w = int(input())
a = []
t = 0
for i in range(0, w):
	p = input().split(' ')
	a.append(p)
for i in range(0, w):
	r = a[i]
	b = 0
	b = int(r[1]) - int(r[0])
	if b >= 2:
		t = t + 1
print(int(t))


n = int(input())
count = 0
for i in range(n):
	(p, q) = list(map(int, input().split()))
	if p == q:
		continue
	elif q - p < 2:
		continue
	else:
		count += 1
print(count)


rooms = int(input())
z = 0
answer = 0
while z < rooms:
	space = input()
	numbers = space.split()
	if int(numbers[1]) >= int(numbers[0]) + 2:
		answer = answer + 1
	z = z + 1
print(answer)


n = int(input())
counter = 0
for i in range(n):
	(a1, a2) = map(int, input().split())
	if a2 - a1 >= 2:
		counter += 1
print(counter)


n = int(input())
c = 0
for i in range(n):
	(P, Q) = map(int, input().split())
	if Q - P > 1:
		c += 1
print(c)


n = int(input())
count = 0
for _ in range(n):
	(peopleLiving, roomCapacity) = map(int, input().split())
	if roomCapacity - peopleLiving >= 2:
		count = count + 1
print(count)


rooms = int(input())
cnt = 1
avail = 0
while cnt <= rooms:
	(p, q) = [int(x) for x in input().split(' ')]
	if q - p >= 2:
		avail += 1
	cnt += 1
print(avail)


n = int(input())
d = 0
for i in range(n):
	(a, b) = map(lambda x: int(x), input().split())
	c = b - a
	if c > 1:
		d = d + 1
	else:
		d = d
print(d)


rooms = int(input())
available = 0
for i in range(rooms):
	chk = list(map(int, input().split()))
	if chk[0] + 2 <= chk[1]:
		available = available + 1
print(available)


total = int(input())
words = list([input().split() for i in range(total)])
c = 0
for i in words:
	if int(i[1]) - int(i[0]) >= 2:
		c += 1
print(c)


print(sum((eval(input().replace(' ', '-')) < -1 for x in [0] * int(input()))))


n = int(input())
l = []
c = 0
for _ in range(0, n):
	k = input()
	k = k.strip().split()
	k[0] = int(k[0])
	k[1] = int(k[1])
	l.append(k)
for i in l:
	slot = i[0]
	mx = i[1]
	if slot + 2 <= mx:
		c += 1
print(c)


n = int(input())
c = 0
for j in range(n):
	(a, b) = [int(x) for x in input().split()]
	if b - a >= 2:
		c += 1
print(c)


n = int(input())
l = []
p = 0
for i in range(n):
	g = input()
	l.append(g)
for j in range(n):
	(c, v) = l[j].split()
	o = int(c) + 1
	if o < int(v):
		p = p + 1
print(p)


a = int(input())
s = []
for i in range(a):
	s.append([int(x) for x in input().split()])
n = 0
for i in s:
	if i[0] == i[1] or i[0] - i[1] == 1 or i[0] - i[1] == -1:
		pass
	else:
		n += 1
print(n)


rooms = int(input())
avaible = 0
for _ in range(rooms):
	(occupied, maximum) = map(int, input().split())
	if maximum - occupied >= 2:
		avaible += 1
print(avaible)


q = int(input())
counter = 0
for _ in range(q):
	(living, max_live) = map(int, input().split())
	if max_live - living >= 2:
		counter += 1
print(counter)


import math
a = []
n = int(input())
c = 0
b = 0
i = 0
j = 0
for i in range(n):
	a.append([int(j) for j in input().split()])
for i in range(n):
	if a[i][0] + 2 <= a[i][1]:
		c += 1
print(c)


n = int(input().strip())
c = 0
for _ in range(n):
	(p, q) = [int(i) for i in input().strip().split()]
	if q - p >= 2:
		c += 1
print(c)


n = int(input())
l = []
for i in range(n):
	l.append(input())
for i in range(len(l)):
	l[i] = l[i].split()
c = 0
for i in l:
	if int(i[1]) - 1 > int(i[0]):
		c += 1
print(c)


count = 0
for y in range(int(input())):
	(a, b) = map(int, input().split())
	if a + 2 <= b:
		count += 1
	else:
		pass
print(count)


room_number = int(input())
counter = 0
for i in range(room_number):
	(roommates, room_capacity) = [int(i) for i in input().split(' ')]
	if room_capacity - roommates >= 2:
		counter += 1
print(counter)


n = int(input())
i = 0
s = 0
while i < n:
	(p, q) = map(int, input().split())
	if q - p >= 2:
		s = s + 1
		i = i + 1
	else:
		i = i + 1
print(s)


n = int(input())
result = 0
for i in range(n):
	room = [int(m) for m in input().split()]
	if room[1] - room[0] > 1:
		result += 1
print(result)


a = int(input())
ans = 0
for num in range(a):
	(b, c) = map(int, input().split())
	if c - b > 1:
		ans += 1
	else:
		continue
print(ans)


n = input()
n = int(n)
i = 1
count = 0
while i <= n:
	(x, y) = input().split(sep=' ')
	x = int(x)
	y = int(y)
	if y >= x + 2:
		count += 1
	i = i + 1
print(count)


c = 0
for _ in range(int(input())):
	(p, q) = list((int(x) for x in input().split()))
	if q - p >= 2:
		c += 1
print(c)


n = int(input())
room = 0
for i in range(0, n):
	(s, t) = input().split()
	if int(t) - int(s) >= 2:
		room = room + 1
	else:
		room = room + 0
print(room)


n = int(input())
r = 0
for i in range(n):
	ints = []
	for i in input().split(' '):
		ints.append(int(i))
	cc = ints[0]
	mc = ints[1]
	if mc - cc >= 2:
		r += 1
print(r)


n = int(input())
room_count = 0
for i in range(n):
	nums = list(map(int, input().split()))
	if nums[1] - nums[0] >= 2:
		room_count += 1
print(room_count)


t = int(input())
r = 0
while t > 0:
	(p, q) = input().split()
	p = int(p)
	q = int(q)
	if p + 2 <= q:
		r += 1
	t -= 1
print(r)


r = int(input())
e = 0
for i in range(r):
	(p, s) = list(map(int, input().split(' ')))
	if s - p >= 2:
		e = e + 1
print(e)


in0 = int(input())
(in1, out0) = (2, 0)
for x in range(in0):
	(in2, in3) = [int(x) for x in input().split()]
	if in1 + in2 <= in3:
		out0 += 1
print(out0)


n = int(input())
res = 0
for i in range(n):
	roomdata = [int(x) for x in input().split()]
	if roomdata[1] - roomdata[0] >= 2:
		res += 1
print(res)


n = int(input())
m = [tuple(map(int, input().split())) for _ in range(n)]
m = list(filter(lambda x: x[1] - x[0] >= 2, m))
print(len(m))


op = int(input())
count = 0
for i in range(op):
	nums = list(map(int, input().split()))
	(x, y) = (nums[0], nums[1])
	if y - x > 1:
		count = count + 1
print(count)


n = int(input())
count = 0
for i in range(n):
	(live_now, can_live) = map(int, input().split())
	if can_live - live_now >= 2:
		count += 1
print(count)


n = int(input())
count = 0
for i in range(n):
	(pi, qi) = map(int, input().split())
	a = qi - pi
	if pi < qi and a != 1:
		count += 1
	elif pi > qi:
		print('0')
print(count)


num_rooms = int(input())
available_room = 0
for i in range(num_rooms):
	(p, q) = map(int, input().split())
	if p <= q - 2:
		available_room += 1
print(available_room)


attempt = input()
attempt = int(attempt)
space = 0
for i in range(0, attempt):
	choice = input()
	choice = choice.split(' ')
	choice = list(map(int, choice))
	if choice[1] - choice[0] >= 2:
		space = space + 1
print(space)


n = int(input())
counter = 0
for x in range(0, n):
	(p, t) = map(int, input().split())
	if t - p >= 2:
		counter += 1
print(counter)


n = int(input())
available = 0
li = [int(a) for i in range(n) for a in input().split(' ')]
l = len(li)
l1 = 0
for i in range(0, l):
	if i == l // 2:
		break
	a = li[i + l1 + 1]
	b = li[i + l1]
	if abs(b - a) >= 2:
		available += 1
	l1 += 1
print(available)


R = int(input())
n = 0
for x in range(R):
	(people, capacity) = map(int, input().split())
	if people + 2 <= capacity:
		n += 1
print(n)


n = int(input())
i = 0
var = 0
while i < n:
	x = list(map(int, input().split()))
	if x[1] - x[0] >= 2:
		var += 1
	i += 1
print(var)


rooms = int(input())
listing = []
counter = 0
for i in range(rooms):
	a = [int(x) for x in input().split()]
	listing.append(a[0])
	listing.append(a[1])
for j in range(rooms):
	if listing[(j - 1) * 2 + 1] - listing[2 * (j - 1)] >= 2:
		counter = counter + 1
print(counter)


n = int(input())
count = 0
for i in range(0, n):
	(p, c) = input().split(' ')
	if int(c) - int(p) >= 2:
		count += 1
print(count)


loop = int(input())
summing = 0
for i in range(0, loop):
	k = input().split()
	if int(k[1]) - int(k[0]) >= 2:
		summing += 1
print(summing)


n = int(input())
s = 0
for i in range(n):
	n1 = list(map(int, input().split()))
	if n1[0] < n1[1] and n1[1] - n1[0] >= 2:
		s = s + 1
print(s)


counter = 0
for i in range(int(input())):
	fr = list(map(int, input().split()))
	(p, q) = (fr[0], fr[1])
	if q - p >= 2:
		counter += 1
print(counter)


n = int(input())
free = 0
for _ in range(n):
	(now, capacity) = list(map(int, input().split()))
	if capacity - now >= 2:
		free += 1
print(free)


i = int(input())
n = 0
delta = []
for i in range(i):
	pq = input().split()
	delta.append(int(pq[1]) - int(pq[0]))
for i in delta:
	if i >= 2:
		n += 1
print(n)


n = int(input())
b = 0
p = []
q = []
f = 0
while b < n:
	(z, m) = map(int, input().split())
	p.append(z)
	q.append(m)
	if q[b] - p[b] > 1:
		f += 1
	b += 1
print(f)


banyak = int(input())
jumlah = 0
for x in range(banyak):
	kamar = input().split()
	if int(kamar[0]) < int(kamar[1]) and int(kamar[1]) - int(kamar[0]) > 1:
		jumlah += 1
print(jumlah)


n = int(input())
a = []
for i in range(0, n):
	(p, q) = list(map(int, input().split()))
	if p == q:
		a.append(0)
	elif p < q and q - p >= 2:
		a.append(1)
print(sum(a))


n = int(input())
my_list = []
new_list1 = []
new_list2 = []
count = 0
for i in range(1, n + 1):
	i = input().split()
	my_list.append(i)
for q in my_list:
	f = int(q[0])
	s = int(q[1])
	x = s - f
	if x > 1:
		count += 1
print(count)


n = int(input())
count = 0
for i in range(n):
	(people, vacancy) = list(map(int, input().split(' ')))
	if vacancy - people >= 2:
		count += 1
print(count)


n = int(input())
count = 0
for i in range(n):
	(p, m) = list(map(int, input().split()))
	if p == m - 2 or p < m - 2:
		count += 1
print(count)


n = int(input())
res = 0
while n > 0:
	(p, q) = [int(x) for x in input().split()]
	if q - p > 1:
		res += 1
	n -= 1
print(res)


room = int(input())
count = 0
while room != 0:
	lis = list(map(int, input().split(' ')))[:2]
	p = lis[0]
	q = lis[1]
	if q - p >= 2:
		count = count + 1
	else:
		count = count + 0
	room = room - 1
print(count)


count = 0
for _ in range(int(input())):
	(to, tt) = list(map(int, input().split()))
	if tt - to > 1:
		count += 1
print(count)


n = int(input())
cnt = 0
for _ in range(n):
	(p, q) = list(map(int, input().split()))
	cnt += int(q - p >= 2)
print(cnt)


n = int(input())
c = 0
pre = 0
aco = 0
for i in range(0, n):
	s = input()
	(pre, aco) = list(s.split(' '))
	if int(aco) - int(pre) >= 2:
		c += 1
print(c)


n = int(input())
Rooms = 0
for x in range(n):
	a = list(map(int, input().split()))
	if a[1] - a[0] >= 2:
		Rooms += 1
print(Rooms)


rooms = int(input())
capacity = []
for i in range(rooms):
	capacity.append(input().split())
for j in range(len(capacity)):
	capacity[j][0] = int(capacity[j][0])
	capacity[j][1] = int(capacity[j][1])
count = 0
for k in range(len(capacity)):
	if capacity[k][1] - capacity[k][0] >= 2:
		count += 1
	else:
		count += 0
print(count)


n = int(input())
ac = 0
for i in range(n):
	(a, b) = map(int, input().split(' '))
	if b > a and b - a > 1:
		ac += 1
print(ac)


import sys
input = sys.stdin.readline

def main():
	n = int(input())
	R = tuple((tuple(map(int, input().rstrip().split())) for _ in range(n)))
	ans = sum((j - i >= 2 for (i, j) in R))
	print(ans)
main()


a = int(input())
ans = 0
for i in range(a):
	(p, q) = map(int, input().split())
	if q - p >= 2:
		ans += 1
print(ans)


t = int(input())
c = 0
while t:
	t -= 1
	(x, y) = map(int, input().split())
	if abs(x - y) >= 2:
		c += 1
print(c)


n = int(input())
c = 0
for i in range(n):
	[pi, qi] = map(int, input().split())
	c += int(qi - pi >= 2)
print(c)


import sys
from random import choice, randint
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def MI():
	return map(int, sys.stdin.readline().strip().split())

def LI():
	return list(map(int, sys.stdin.readline().strip().split()))

def LLI():
	return [list(map(int, l.split())) for l in sys.stdin.readlines().strip()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().strip().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().strip().split()]

def LS():
	return sys.stdin.readline().strip().split()

def I():
	return int(sys.stdin.readline().strip())

def F():
	return float(sys.stdin.readline().strip())

def S():
	return sys.stdin.readline().strip()

def pf(s):
	return print(s, flush=True)

def pe(s):
	return print(str(s), file=sys.stderr)

def JA(a, sep):
	return sep.join(map(str, a))

def JAA(a, s, t):
	return s.join((t.join(map(str, b)) for b in a))
inp = sys.stdin.readline
out = sys.stdout.write

def main():
	n = I()
	c = 0
	for i in range(n):
		(p, q) = MI()
		if q - p >= 2:
			c += 1
	pf(c)
main()


n = int(input())
ans = 0
for i in range(n):
	(u, v) = map(int, input().strip().split())
	if u + 2 <= v:
		ans += 1
print(ans)


p = int(input())
c = 0
for i in range(p):
	(a, b) = map(int, input().split())
	d = b - a
	if d >= 2:
		c += 1
	else:
		continue
print(c)


n = int(input())
j = 0
for i in range(n):
	b = list(map(int, input().split()))
	if b[1] - b[0] >= 2:
		j = j + 1
print(j)


n = int(input())
count = 0
for i in range(n):
	line = input().split()
	a = int(line[0])
	b = int(line[1])
	if b >= a + 2:
		count += 1
print(count)


number_of_rooms = int(input())
counter = 0
for i in range(number_of_rooms):
	number = [int(n) for n in input().split()]
	if number[1] - number[0] >= 2:
		counter += 1
	else:
		continue
print(counter)


__author__ = 'runekri3'
good_rooms = 0
n = int(input())
for _ in range(n):
	(people, capacity) = list(map(int, input().split()))
	if capacity - people >= 2:
		good_rooms += 1
print(good_rooms)


n = int(input())
p = []
q = []
k = 0
for i in range(n):
	a = [int(i) for i in input().split()]
	p.append(a[0])
	q.append(a[1])
for i in range(len(p)):
	if q[i] - p[i] >= 2:
		k += 1
print(k)


n = int(input())
capacity = 0
for p in range(n):
	(x, y) = [int(i) for i in input().split()]
	if x < y - 1:
		capacity += 1
	else:
		capacity += 0
print(capacity)


c = int(input())
r = 0
for i in range(c):
	(n1, n2) = list(map(int, input().split()))
	if n2 - n1 >= 2:
		r += 1
print(r)


print(sum((int.__sub__(*map(int, input().split())) <= -2 for _ in range(int(input())))))


t = int(input())
counter = 0
for _ in range(t):
	(a, b) = list(map(int, input().split()))
	if b - a >= 2:
		counter += 1
print(counter)


import math
import re
a = int(input())
b = 0
for i in range(a):
	(p, q) = map(int, input().split())
	if q - p >= 2:
		b += 1
print(b)


def answer():
	(n, ans) = (int(input()), 0)
	while n:
		now = input().split()
		space = int(now[1]) - int(now[0])
		if space > 1:
			ans += 1
		n -= 1
	return ans
print(answer())


t = int(input())
sum = 0
for i in range(t):
	n = list(map(int, input().split()))
	if n[1] - n[0] >= 2:
		sum += 1
print(sum)


n = int(input())
count = 0
for i in range(n):
	(taken, capacity) = map(int, input().split())
	if capacity - taken >= 2:
		count += 1
print(count)


n = int(input())
counter = 0
for k in range(0, n):
	room = list(map(int, input().split()))
	if room[0] < room[1] - 1:
		counter += 1
print(counter)


def main():
	n = int(input())
	count = 0
	for i in range(n):
		(people, capacity) = input().split()
		people = int(people)
		capacity = int(capacity)
		if capacity - people >= 2:
			count += 1
	print(count)
main()


import sys
import math

def main():
	n = int(sys.stdin.readline().strip())
	cnt = 0
	for i in range(n):
		(p, q) = list(map(int, sys.stdin.readline().strip().split(' ')))
		if q - p >= 2:
			cnt += 1
	sys.stdout.write(str(cnt))
main()


t = int(input())
number = 0
for test in range(0, t):
	(n, c) = map(int, input().split())
	if c - n >= 2:
		number += 1
print(number)


def main():
	n = int(input())
	res = 0
	for _ in range(n):
		(pi, qi) = map(int, input().split())
		if qi - pi >= 2:
			res += 1
	print(res)
main()


N = int(input())
total = 0
for n in range(N):
	(p, q) = [int(x) for x in input().split(' ')]
	if p <= q - 2:
		total += 1
print(total)


n = int(input())
m = 0
while n > 0:
	(p, q) = [int(i) for i in input().split()]
	if q - p >= 2:
		m += 1
	else:
		pass
	n -= 1
print(m)


n = int(input())
num = 0
for x in range(n):
	(p, q) = [int(y) for y in input().split()]
	if q - p >= 2:
		num += 1
print(num)


n = int(input())
res = 0
for i in range(n):
	(k, max) = map(int, input().split())
	if max - k >= 2:
		res += 1
print(res)


rooms_count = int(input())
fit_rooms_count = 0
for i in range(0, rooms_count):
	(people_in_room, room_capacity) = [int(x) for x in input().split()]
	if room_capacity - people_in_room >= 2:
		fit_rooms_count += 1
print(fit_rooms_count)


pom = 0
n = int(input())
for i in range(n):
	n = [int(i) for i in input().split()]
	if n[1] - n[0] >= 2:
		pom += 1
print(pom)


n = int(input())
t = 0
for i in range(n):
	A = list(map(int, input().split()))
	m = int(A[1]) - int(A[0])
	if m >= 2:
		t = t + 1
	else:
		pass
print(t)


k = int(input())
p = 0
for i in range(k):
	(a, b) = map(int, input().split())
	if b - a >= 2:
		p += 1
print(p)


n = int(input())
count = 0
for item in range(n):
	(z, k) = map(int, input().split())
	if k - z >= 2:
		count += 1
print(count)


ans = 0
for i in range(int(input())):
	(p, q) = input().split(' ')
	if int(q) - int(p) != 0 and int(q) - int(p) != 1:
		ans += 1
print(ans)


a = int(input())
c = 0
for i in range(a):
	(n, m) = [int(i) for i in input().split()]
	if m - n > 1:
		c += 1
print(c)


n = int(input())
cnt = 0
for _ in range(n):
	(a, b) = map(int, input().rstrip().split())
	if b - a >= 2:
		cnt += 1
print(cnt)


number = int(input())
lst = []
for i in range(number):
	lst.append([])
	lst[i].append(input())
	lst[i] = ' '.join(lst[i])
	lst[i] = lst[i].split(' ')
ans = 0
for i in range(number):
	if int(lst[i][0]) + 2 <= int(lst[i][1]):
		ans += 1
print(ans)


a = int(input())
res = 0
for i in range(a):
	s = input().split()
	p = int(s[0])
	q = int(s[1])
	if q - p >= 2:
		res += 1
	else:
		res = res
print(res)


counter = 0
for _ in range(int(input())):
	(p, q) = map(int, input().split())
	counter += 1 if p + 2 <= q else False
print(counter)


n = int(input())
count = 0
for i in range(0, n):
	(a, k) = [int(x) for x in input().split()]
	if k - a >= 2:
		count += 1
print(count)


MOD = 1000000007
ii = lambda : int(input())
si = lambda : input()
dgl = lambda : list(map(int, input()))
f = lambda : map(int, input().split())
il = lambda : list(map(int, input().split()))
ls = lambda : list(input())
from collections import *
c = 0
for _ in range(ii()):
	(p, q) = f()
	if q - p >= 2:
		c = c + 1
print(c)


a = int(input())
num = 0
for i in range(a):
	(p, q) = [int(j) for j in input().split()]
	if q - p >= 2:
		num += 1
	else:
		num += 0
print(num)


n = int(input())
total = 0
for i in range(n):
	numbers = list(map(int, input().split()))
	if numbers[1] - numbers[0] >= 2:
		total += 1
print(total)


def solve_the_problem():
	rooms_nr = int(input())
	res = 0
	for i in range(0, rooms_nr):
		(people, capacity) = [int(x) for x in input().split(' ')]
		if capacity - people >= 2:
			res += 1
	print(res)
solve_the_problem()


t = int(input())
count = 0
for _ in range(t):
	(x, y) = map(int, input().split())
	if y - x >= 2:
		count += 1
print(count)


tcase = int(input())
ctr = 0
while tcase > 0:
	tcase -= 1
	(p, q) = map(int, input().split())
	if q - p >= 2:
		ctr += 1
print(ctr)


komnat = int(input())
ok = 0
for i in range(komnat):
	(check1, check2) = map(int, input().split())
	if check2 >= check1 + 2:
		ok += 1
print(ok)


n = int(input())
k = [[int(_) for _ in input().split()] for _ in range(n)]
print(len([y for y in [x[1] - x[0] for x in k] if y >= 2]))


n = int(input())
print(sum((eval(input().replace(' ', '-')) <= -2 for _ in range(n))))


numbre = int(input())
count = 0
for num in range(numbre):
	string = str(input()).split()
	room_capsity = int(string[1])
	number_people = int(string[0])
	if number_people < room_capsity and number_people <= room_capsity - 2:
		count += 1
print(count)


n = int(input())
ct = 0
for _ in range(n):
	(pi, qi) = map(int, input().split())
	if qi - pi >= 2:
		ct += 1
print(ct)


a = int(input())
m = []
s = 0
for i in range(0, a):
	m.append([int(x) for x in input().split(' ')])
	if m[i][1] - m[i][0] > 1:
		s += 1
print(s)


rooms = int(input())
n = 0
for x in range(rooms):
	string = input()
	numbers = string.split(' ')
	if int(numbers[1]) - int(numbers[0]) >= 2:
		n += 1
print(n)


n = int(input())
r = 0
for i in range(n):
	rp = input().split()
	if int(rp[1]) - int(rp[0]) > 1:
		r += 1
print(r)


def Main():
	n = int(input())
	ans = 0
	for i in range(n):
		(x, y) = map(int, input().split())
		if y - x > 1:
			ans += 1
	print(ans)
Main()


numRooms = int(input())
roomsAval = 0
for times in range(numRooms):
	list = [int(x) for x in input().split(' ')]
	p = list[0]
	q = list[1]
	if q - p >= 2:
		roomsAval += 1
print(roomsAval)


n = int(input())
count = 0
for i in range(n):
	room = [int(i) for i in input().split()]
	men = room[0]
	max = room[1]
	if max - men >= 2:
		count += 1
print(count)


n = int(input())
c = 0
while n:
	i = input().split()
	if int(i[1]) - int(i[0]) > 1:
		c += 1
	n -= 1
print(c)


num = 0
for i in range(int(input())):
	li = list(map(int, input().split(' ')))
	if li[1] - li[0] >= 2:
		num += 1
	else:
		pass
print(num)


import os
import sys
from io import BytesIO, IOBase

def main():
	n = int(input())
	ans = 0
	for x in range(n):
		(a, b) = map(int, input().split(' '))
		ans += 1 if b - a >= 2 else 0
	print(ans)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


num = int(input())
hotel = [[] for i in range(num)]
for i in range(num):
	line = input().split(' ')
	for j in range(len(line)):
		hotel[i].append(int(line[j]))
check = 0
for i in range(num):
	if hotel[i][1] - hotel[i][0] >= 2:
		check += 1
print(check)


N = int(input())
cnt = 0
for x in range(1, N + 1):
	(c, lp) = [int(x) for x in input().split()]
	if c + 2 <= lp:
		cnt = cnt + 1
print(cnt)


n = int(input())
flag = 0
count = 0
for i in range(n):
	(p, q) = map(int, input().split())
	if p >= q:
		flag = 0
	elif p < q:
		if q - p >= 2:
			flag = 1
			count += 1
print(count)


n = int(input())
list_0 = []
for i in range(n):
	str_0 = input()
	list_1 = str_0.split(' ')
	list_0.append([int(list_1[0]), int(list_1[1])])
	n = 0
for i in list_0:
	if i[1] - i[0] >= 2:
		n += 1
print(n)


(n, s) = (int(input()), 0)
for _ in [0] * n:
	(x, y) = map(int, input().split())
	s += y - x > 1
print(s)


number = int(input())
index = 0
for i in range(number):
	(a, b) = map(int, input().split())
	if b - a >= 2:
		index = index + 1
print(index)


rooms = int(input())
can_live = 0
for i in range(rooms):
	s = [int(i) for i in input().split()]
	if s[1] - s[0] >= 2:
		can_live += 1
print(can_live)


__author__ = 'widoc'
n = int(input())
res = 0
for i in range(n):
	(a, b) = map(int, input().split())
	if b - a >= 2:
		res += 1
print(res)


import sys
n = int(sys.stdin.readline().split()[0])
rooms = [[0 for x in range(2)] for y in range(n)]
row = 0
for line in sys.stdin:
	column = 0
	for word in line.split():
		rooms[row][column] = int(word)
		column += 1
	row += 1
rooms_acceptable = 0
for room in rooms:
	if room[0] + 2 <= room[1]:
		rooms_acceptable += 1
print(rooms_acceptable)


n = int(input())
p = []
q = []
l = []
count = 0
for i in range(n):
	l.append(input().split())
for i in l:
	p.append(i[0])
	q.append(i[1])
for i in range(len(p)):
	p[i] = int(p[i])
	q[i] = int(q[i])
for i in range(0, n):
	if int(q[i]) - int(p[i]) >= 2:
		count += 1
	else:
		None
print(count)


total = 0
y = int(input())
for i in range(y):
	(x, y) = input().split()
	if int(x) + 2 <= int(y):
		total += 1
print(total)


n = int(input())
r = 0
for i in range(0, n):
	(p, q) = input().split()
	p = int(p)
	q = int(q)
	if q - p > 1:
		r = r + 1
print(r)


ans = 0
for _ in range(int(input())):
	(p, q) = map(int, input().split())
	ans += q - p > 1
print(ans)


def solution():
	rooms = []
	rooms_amount = int(input())
	for i in range(0, rooms_amount):
		rooms.append(str(input()))
	available_rooms = 0
	for j in rooms:
		(occupied, max_people) = map(int, j.split(' '))
		if occupied + 2 <= max_people:
			available_rooms += 1
	return available_rooms
print(solution())


count = 0
dormitory = []
n = int(input())
for i in range(n):
	inp = list(map(int, input().split()))
	dormitory.append(inp)
for i in range(n):
	if dormitory[i][1] - dormitory[i][0] >= 2:
		count += 1
print(count)


import math
import os
import random
import re
from sys import stdin, stdout
from collections import Counter

def si():
	return str(input())

def ii():
	return int(input())

def mi():
	return map(int, input().split())

def li():
	return list(mi())
t = ii()
c = 0
for i in range(t):
	(p, q) = mi()
	if q - p >= 2:
		c += 1
print(c)
c = 0


from sys import stdin, stdout

def main():
	inp = int(input(''))
	count = 0
	room = 0
	while count < inp:
		arr = [int(i) for i in input().split(' ')]
		if arr[1] - arr[0] >= 2:
			room += 1
		count += 1
	print(room)
main()


b = 0
for i in [0] * int(input()):
	(m, n) = map(int, input().split())
	if n - m >= 2:
		b += 1
print(b)


def howManyLeft(arr):
	return sum([1 for p in arr if p[1] - p[0] >= 2])
xRooms = int(input())
print(howManyLeft([[int(i) for i in input().split()] for i in range(xRooms)]))


n = int(input())
k = 0
for i in range(n):
	l = input().split()
	p = int(l[0])
	q = int(l[1])
	if q - p >= 2:
		k += 1
print(k)


n = int(input())
counter = 0
while n:
	(present, capacity) = map(int, input().split())
	if capacity - present >= 2:
		counter += 1
	n -= 1
print(counter)


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, copy, functools
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return [int(x) for x in sys.stdin.readline().split()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().split()]

def LS():
	return sys.stdin.readline().split()

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def S():
	return input()

def pf(s):
	return print(s, flush=True)

def main():
	n = I()
	r = 0
	for _ in range(n):
		(a, b) = LI()
		if a + 2 <= b:
			r += 1
	return r
print(main())


n = int(input())
s = 0
for k in range(n):
	(a, b) = map(int, input().split())
	s += [0, 1][b - a >= 2]
print(s)


n = int(input())
rooms_free = 0
for i in range(n):
	v = input().split()
	e = int(v[0])
	h = int(v[1])
	if h - e >= 2:
		rooms_free += 1
print(rooms_free)


n = int(input())
matrix = [0] * n
for i in range(n):
	matrix[i] = list(map(int, input().split()))
res = 0
for i in range(n):
	if matrix[i][1] - matrix[i][0] > 1:
		res += 1
print(res)


def met(s, p):
	if p > s + 1:
		return 1
	return 0
n = int(input())
r = 0
for i in range(n):
	(a, b) = tuple(map(int, input().split(' ')))
	r += met(a, b)
print(r)


from random import randint
n = int(input())
sum = 0
for i in range(1, n + 1):
	(a, b) = map(int, input().split())
	if b - a > 1:
		sum += 1
print(sum)


a = 0
for _ in range(int(input())):
	(m, s) = list(map(int, input().split()))
	if s - m >= 2:
		a += 1
print(a)


n = int(input())
count = 0
for i in range(n):
	(o, t) = map(int, input().split())
	v = t - o
	if v >= 2:
		count += 1
print(count)


def room(x, y):
	if y - x >= 2:
		return True
x = int(input())
j = 0
for i in range(0, x):
	(z, y) = map(int, input().split())
	if y - z >= 2:
		j += 1
print(j)


def check(m, n):
	if m + 2 <= n:
		return 1
	return 0

def main():
	n = input()
	cnt = 0
	for i in range(int(n)):
		(m, n) = map(int, input().split())
		cnt += check(m, n)
	print(cnt)
main()


n = int(input())
roompossible = 0
for i in range(n):
	l = [int(a) for a in input().split()]
	if l[0] < l[1] and l[0] <= l[1] - 2:
		roompossible += 1
	l = []
print(roompossible)


n = int(input())
d = []
D = []
for i in range(0, n):
	d = input()
	d = d.split()
	d = [int(i) for i in d]
	D += d
numcu = sum((1 for i in range(0, n) if D[2 * i + 1] - D[2 * i] > 1))
print(numcu)


n = int(input())
rooms = 0
for i in range(n):
	room = list(map(int, input().split(' ')))
	space = room[1] - room[0]
	if space >= 2:
		rooms += 1
print(rooms)


print(sum(((lambda x, y: y - x >= 2)(*[int(i) for i in input().split()]) for i in range(int(input())))))


r_cnt = 0
for _ in range(int(input())):
	s = input().split()
	if abs(int(s[0]) - int(s[1])) >= 2:
		r_cnt += 1
print(r_cnt)


count = 0
for _ in range(int(input())):
	(active, capacity) = tuple(map(int, input().split()))
	if active + 2 <= capacity:
		count += 1
print(count)


n = int(input())
countFree = 0
countEmployed = 0
i = 0
while n > 0:
	t = [int(x) for x in input().split(' ')]
	countFree = t[1]
	countEmployed = t[0]
	if countFree - countEmployed - 2 >= 0:
		i += 1
	n -= 1
print(i)


n = int(input())
list1 = []
for i in range(n):
	b = input().split()
	b = list(map(int, b))
	list1.append(b)
counter = 0
for i in list1:
	if i[1] - i[0] >= 2:
		counter += 1
print(counter)


t = int(input())
c = 0
for g in range(t):
	(a, b) = map(int, input().split())
	d = abs(b - a)
	if d > 1:
		c = c + 1
print(c)


n = int(input())
cnt = 0
for i in range(n):
	arr = [int(j) for j in input().split()]
	if arr[1] - arr[0] > 1:
		cnt += 1
print(cnt)


n = int(input())
free = 0
for i in range(0, n):
	(p, q) = [int(i) for i in input().split()]
	free = free + 1 if q - p > 1 else free
print(free)


n = int(input())
count = 0
p_i = 0
q_i = 0
for _ in range(n):
	(p_i, q_i) = map(int, input().split())
	if p_i == q_i or q_i - p_i == 1:
		continue
	else:
		count += 1
print(count)


amount = int(input())
counter = 0
for i in range(amount):
	(alr, max) = [int(i) for i in input().split()]
	if max - alr > 1:
		counter += 1
print(counter)


n = eval(input())
lis = list()
possible = 0
for i in range(n):
	lis = list(map(int, input().strip().split()))
	p = lis[0]
	q = lis[1]
	if q - p >= 2:
		possible += 1
print(possible)


def input_number():
	return int(input())

def input_numbers():
	return map(int, input().split(' '))
n = input_number()
i = 0
rooms = 0
while i < n:
	(p, q) = input_numbers()
	if p + 2 <= q:
		rooms += 1
	i += 1
print(rooms)


n = int(input())
s = []
c = 0
for i in range(n):
	a = [int(i) for i in input().split()]
	s.append(a)
for i in range(n):
	if s[i][1] - s[i][0] >= 2:
		c += 1
print(c)


a = int(input())
mat = []
res = 0
for i in range(a):
	s = input().split()
	for i in range(len(s)):
		s[i] = int(s[i])
	mat.append(s)
for i in mat:
	if i[1] - i[0] >= 2:
		res += 1
print(res)


n = int(input())
res = 0
for _ in range(n):
	(p, q) = map(int, input().split())
	res += q - p >= 2
print(res)


q = lambda : map(int, input().split())
qi = lambda : int(input())
qs = lambda : input().split()
c = 0
for i in range(qi()):
	(x, y) = q()
	c += x <= y - 2
print(c)


number_of_rooms = int(input())
count = 0
for i in range(number_of_rooms):
	(residents_in_room, room_capacity) = [int(i) for i in input().split()]
	if room_capacity - residents_in_room >= 2:
		count += 1
print(count)


n = int(input())
l = []
for i in range(n):
	l.append([])
	l[i] = []
	l[i] = input().split(' ')
	for j in range(2):
		l[i][j] = int(l[i][j])
ch = 0
for i in range(len(l)):
	if l[i][1] - l[i][0] > 1:
		ch += 1
	else:
		pass
print(ch)


num = int(input())
counter = 0
for i in range(num):
	line = input().split()
	if int(line[1]) - int(line[0]) >= 2:
		counter += 1
print(str(counter))


a = int(input())
b = []
c = 0
while a > 0:
	(d, e) = map(int, input().split())
	if e - d >= 2:
		c += 1
	a -= 1
print(c)


room_num = int(input().strip())
room_cnt = 0
for x in range(room_num):
	(p, q) = map(int, input().strip().split(' '))
	if p + 2 <= q:
		room_cnt += 1
print(room_cnt)


print(sum([1 for (p, q) in [[int(n) for n in input().split()] for i in range(int(input()))] if q - p >= 2]))


def ura():
	n = int(input())
	l = []
	k = 0
	r = 0
	for i in range(n):
		(p, q) = map(int, input().split())
		l.append(p)
		l.append(q)
	while k < len(l):
		if l[k + 1] - l[k] >= 2:
			r += 1
		k += 2
	return r
print(ura())


x = int(input())
cnt = 0
for _ in range(x):
	(p, q) = map(int, input().split())
	if q - p == 0:
		cnt += 0
	elif q - p > 1:
		cnt += 1
print(cnt)


n = int(input())
A = []
count = 0
for i in range(n):
	B = [int(i) for i in input().split()]
	A.append(B)
for i in A:
	if i[1] - i[0] > 1:
		count += 1
print(count)


import math
import os
import sys
import re
import itertools
import functools
import operator
res = 0
for _ in range(int(input())):
	(a, b) = map(int, input().split())
	res = res + (1 if a + 2 <= b else 0)
print(res)


k = int(input())
sum = 0
for x in range(k):
	(a, b) = input().split(' ')
	a = int(a)
	b = int(b)
	if b - a >= 2:
		sum += 1
print(sum)


c = 0
for i in range(int(input())):
	(people, cap) = map(int, input().split())
	if cap - people >= 2:
		c += 1
print(c)


n = int(input())
l = []
k = []
c = 0
while n:
	(x, y) = map(int, input().split())
	l.append(x)
	k.append(y)
	n = n - 1
for i in range(len(l)):
	if l[i] + 2 <= k[i]:
		c += 1
print(c)


rooms = int(input())
good_rooms = 0
for i in range(rooms):
	(p, q) = [int(x) for x in input().split(' ')]
	if p <= q - 2:
		good_rooms += 1
print(good_rooms)


n = int(input())
list1 = []
for i in range(1, n + 1):
	x = tuple(map(int, input().split()))
	list1.append(x)
count = 0
free = 0
for i in range(1, n + 1):
	a = list1[count]
	b = a[0]
	c = a[1]
	if c - b >= 2:
		free += 1
	count += 1
print(free)


n = int(input())
count = 0
while n > 0:
	n -= 1
	str = input().split()
	p = int(str[0])
	q = int(str[1])
	if p + 2 <= q:
		count += 1
print(count)


s = int(input())
res = 0
for i in range(0, s):
	inp = input().split()
	inp[0] = int(inp[0])
	inp[1] = int(inp[1])
	if inp[0] + 2 <= inp[1]:
		res += 1
print(res)


x = int(input())
a = []
c = 0
for i in range(x):
	y = list(input().split(' '))
	a.append(y)
for i in range(x):
	if int(a[i][1]) - int(a[i][0]) >= 2:
		c = c + 1
print(c)


n = int(input())
final = []
count = 0
for i in range(n):
	m = input().split()
	final.append(m)
for i in final:
	s = int(i[1]) - int(i[0])
	if s >= 2:
		count += 1
print(count)


c = d = 0
l1 = []
l2 = []
n = int(input())
for i in range(0, n):
	(n, m) = map(int, input().split(' '))
	l1.append(n)
	l2.append(m)
for i in range(0, len(l1)):
	if l1[i] < l2[i] - 1:
		c += 1
	else:
		continue
print(c)


rooms = int(input())
currentCapacities = [list(map(int, input().split())) for i in range(rooms)]
possibleRooms = 0
for room in currentCapacities:
	if room[1] - room[0] >= 2:
		possibleRooms += 1
print(possibleRooms)


a = int(input())
l = [input().split() for x in range(a)]
m = []
(n, am) = (0, 0)

def check(x, y):
	if int(x) + 2 <= int(y):
		return 1
	else:
		return 0
for i in l:
	for j in i:
		m.append(j)
for i in range(a):
	p = check(m[n], m[n + 1])
	if p == 1:
		am += 1
	n += 2
print(am)


n = int(input())
count = 0
for i in range(n):
	(r, cap) = map(int, input().split())
	if cap - r >= 2:
		count += 1
print(count)


count = input()
liberty = 0
for i in range(int(count)):
	(l, p) = input().split(' ')
	l = int(l)
	p = int(p)
	if p - l >= 2:
		liberty += 1
print(liberty)


input_room = int(input())
c = 0
for i in range(input_room):
	list_input = [int(i) for i in input().split(' ')]
	teded_people = list_input[0]
	capacity_room = list_input[1]
	for i in range(input_room):
		if capacity_room - teded_people > 1:
			c += 1
print(int(c / input_room))


a = int(input())
l = [tuple(map(int, input().split())) for i in range(a)]
c = 0
for (a, al) in l:
	if al - a >= 2:
		c += 1
print(c)


n = int(input())
j = 0
for i in range(n):
	(P, Q) = input().split()
	p = int(P)
	q = int(Q)
	if q - p > 1:
		j += 1
print(j)


def solution():
	k = int(input())
	(p, q) = ([], [])
	c = 0
	for _ in range(k):
		(x, y) = (int(i) for i in input().split(' '))
		if 2 <= abs(x - y):
			c += 1
	print(c)
solution()


n = int(input())
cnt = 0
for i in range(n):
	ab = input().split()
	a = int(ab[0])
	b = int(ab[1])
	if abs(b - a) != 0 and abs(b - a) >= 2:
		cnt += 1
print(cnt)


n = int(input())
l = [list(input().split()) for i in range(n)]
j = 0
for i in range(n):
	if int(l[i][1]) - int(l[i][0]) > 1:
		j += 1
print(j)


n = int(input())
x = 0
for e in range(n):
	(p, q) = map(int, input().split())
	a = q - p
	if a >= 2:
		x += 1
print(x)


rooms = int(input())
result = 0
for room in range(rooms):
	values = input().split()
	(current, capacity) = (int(values[0]), int(values[1]))
	if capacity - current >= 2:
		result += 1
print(result)


size = int(input())
cou = 0
for i in range(size):
	(room, capacity) = input().split()
	tem = int(capacity) - int(room)
	if tem >= 2:
		cou += 1
print(cou)


n = int(input())
a = []
count = 0
for x in range(n):
	a += list(map(int, input().split()))
i = 0
while i < n * 2:
	if abs(a[i] - a[i + 1]) >= 2:
		count += 1
	i += 2
print(count)


def main():
	from sys import stdout
	n = int(input())
	res = 0
	for i in range(n):
		(p, q) = map(int, input().split())
		if q - p >= 2:
			res += 1
	stdout.write(str(res))
main()


from sys import stdin
n = int(input())

def main(n, strm):
	c = 0
	for i in range(n):
		(p, q) = [int(e) for e in strm.readline().split()]
		if q - p >= 2:
			c += 1
	return c
print(main(n, stdin))


n = int(input())
count = 0
for i in range(n):
	arr = [int(n) for n in input().split()]
	if arr[1] - arr[0] >= 2:
		count = count + 1
	else:
		continue
print(count)


ans = 0
for i in range(int(input())):
	number = list(map(int, input().split()))
	if number[1] - number[0] >= 2:
		ans += 1
print(ans)


n = int(input())
c = 0
for i in range(n):
	s = [int(i) for i in input().split()]
	if s[1] - s[0] >= 2:
		c += 1
	else:
		pass
print(c)


ct = 0
for I in range(int(input())):
	(p, q) = map(int, input().split())
	if q - p >= 2:
		ct += 1
print(ct)


N = int(input())
T = 0
for j in range(N):
	(p, q) = map(int, input().split())
	if q - p > 1:
		T += 1
print(T)


cnt = 0
n = int(input())
for i in range(n):
	ip = input()
	ip = ip.split(' ')
	p = int(ip[0])
	q = int(ip[1])
	if q - p > 1:
		cnt += 1
print(cnt)


count = 0
a = int(input())
b = []
for i in range(a):
	b.append(input().split())
for i in range(len(b)):
	if int(b[i][0]) + 1 < int(b[i][1]):
		count += 1
print(count)


def main():
	n = int(input())
	o = 0
	for i in range(n):
		(a, b) = map(int, input().split())
		if b - a >= 2:
			o += 1
	print(o)
main()


n = int(input())
vacants = []
for i in range(n):
	(p, q) = input().split(' ')
	(p, q) = (int(p), int(q))
	vacants.append(q - p)
dem = 0
for vacant in vacants:
	if vacant >= 2:
		dem += 1
print(dem)


rooms = int(input())
n = 0
for i in range(rooms):
	status = list(map(int, input().split()))
	if status[1] - status[0] >= 2:
		n += 1
print(n)


def main():
	from sys import stdin, stdout
	count = 0
	for _ in range(int(stdin.readline())):
		(a, b) = map(int, stdin.readline().split())
		if b - a >= 2:
			count += 1
	stdout.write(str(count))
main()


def main():
	n = int(input())
	i = 0
	rooms = 0
	while i < n:
		m = input().split()
		if int(m[1]) - int(m[0]) >= 2:
			rooms += 1
		else:
			pass
		i += 1
	print(rooms)
main()


a = int(input())
counter = 0
for i in range(a):
	b = list(map(int, input().split()))
	if b[1] - b[0] >= 2:
		counter += 1
print(counter)


n = int(input())
c = 0
for i in range(n):
	k = list(map(int, input().split()))
	if k[0] == k[1]:
		continue
	elif k[0] < k[1] - 1:
		c += 1
print(c)


n = int(input())
ls = []
ls2 = []
counter = 0
for i in range(0, n):
	ls2 = input().split(' ')
	ls.append(ls2)
for i in range(0, n):
	n1 = int(ls[i][0])
	n2 = int(ls[i][1])
	if n1 < n2 - 1:
		counter += 1
print(counter)


x = int(input())
d = 0
for i in range(x):
	y = list(map(int, input().split()))
	a = int(y[0])
	b = int(y[1])
	c = b - a
	if c >= 2:
		d += 1
	else:
		d = d
print(d)


number_of_rooms = int(input())
rooms_available = 0
for x in range(1, number_of_rooms + 1):
	room_input = input()
	number_of_people_who_already_lived_in_the_room = int(room_input.split()[0])
	room_capacity = int(room_input.split()[1])
	if room_capacity - number_of_people_who_already_lived_in_the_room >= 2:
		rooms_available += 1
print(rooms_available)


j = 0
for i in range(0, int(input())):
	a = list(map(int, input().split()))
	if a[1] - a[0] >= 2:
		j += 1
print(j)


izieb = int(input())
volnych = 0
for izba in range(izieb):
	(zaplnene, kapacita) = map(int, input().split())
	if kapacita - zaplnene >= 2:
		volnych += 1
print(volnych)


n = int(input())
cnt = 0
for i in range(n):
	(pi, qi) = input().split()
	pi = int(pi)
	qi = int(qi)
	available = qi - pi
	if available >= 2:
		cnt = cnt + 1
print(cnt)


from array import *
n = int(input())
p = array('i', [])
q = array('i', [])
count = 0
for i in range(n):
	(x, y) = [int(x) for x in input().split()]
	p.append(x)
	q.append(y)
i = 0
while i < len(p):
	if q[i] - p[i] >= 2:
		count += 1
		i += 1
	else:
		i += 1
print(count)


x = int(input())
i = 0
v = 0
while i < x:
	(p, q) = input().split()
	if int(q) - int(p) >= 2:
		v = v + 1
	i += 1
print(v)


n = int(input())
x = 0
X = 0
for i in range(n):
	(a, b) = map(int, input().split())
	x = b - a
	if x >= 2:
		X += 1
print(X)


n = int(input())
p = []
q = []
numberOfRooms = 0
for i in range(0, n):
	(x, y) = (int(e) for e in input().split(' '))
	p.append(x)
	q.append(y)
for i in range(0, n):
	if q[i] - p[i] >= 2:
		numberOfRooms += 1
print(numberOfRooms)


n = int(input())
cnt = 0
for i in range(n):
	(x, y) = list(map(int, input().split()))
	if y - x >= 2:
		cnt += 1
print(cnt)


noOfRooms = int(input())
res = 0
for i in range(noOfRooms):
	(p, q) = map(int, input().split())
	if q - p >= 2:
		res += 1
print(res)


t = int(input())
s = 0
while t != 0:
	(p, q) = list(map(int, input().split()))
	if q - p >= 2:
		s = s + 1
	t = t - 1
print(s)


no_rooms = int(input())
i = 0
count = 0
while i < no_rooms:
	my_input = input()
	temp = my_input.split()
	people = int(temp[0])
	acco = int(temp[1])
	if acco - people >= 2:
		count += 1
	i += 1
print(count)


n = int(input())
k = 0
for i in range(n):
	(p, g) = map(int, input().split())
	if p + 2 <= g:
		k = k + 1
print(k)


n = int(input())
ans = 0
for i in range(n):
	inp = list(map(int, input().split()))
	ans += 1 if inp[1] - inp[0] > 1 else 0
print(ans)


a = input()
a = int(a)
s = 0
for i in range(a):
	(a, b) = input().split(' ')
	(a, b) = (int(a), int(b))
	if abs(a - b) >= 2:
		s += 1
	else:
		s = s
print(s)


i = 0
for _ in range(int(input())):
	(p, q) = map(int, input().split())
	if q >= p + 2:
		i += 1
print(str(i))


n = int(input())
count = 0
for h in range(n):
	(p, q) = map(int, input().split())
	if q - p >= 2:
		count += 1
print(count)


ans = 0
for x in range(int(input())):
	s = input().split()
	(p, q) = (int(s[0]), int(s[1]))
	if q - p >= 2:
		ans += 1
print(ans)


number = int(input())
count = 0
for i in range(number):
	(people, capacity) = map(int, input().split(' '))
	if people < capacity:
		subtract = capacity - people
		if subtract >= 2:
			count = count + 1
		else:
			continue
print(count)


x = int(input())
l = 0
for i in range(x):
	(y, z) = map(int, input().split(' '))
	if z - y >= 2:
		l = l + 1
print(l)


x = int(input())
arr = []
for i in range(x):
	arr.append(list(map(int, input().split())))
s = 0
for l in range(x):
	if arr[l][1] - arr[l][0] >= 2:
		s += 1
if s > 0:
	print(s)
else:
	print(0)


import math

def abir():
	return map(int, input().split())
b = int(input())
cnt = 0
for i in range(b):
	a = []
	a = list(abir())
	if a[1] - a[0] >= 2:
		cnt += 1
print(cnt)


n = 0
for a in range(int(input())):
	list1 = list(map(int, input().split()))
	if list1[0] + 2 <= list1[1]:
		n += 1
print(n)


def fd70000000():
	n = int(input())
	counter = 0
	for i in range(n):
		p_q = list(map(int, input().split()))
		if p_q[1] - p_q[0] >= 2:
			counter += 1
	return print(counter)
fd70000000()


ans = 0
for i in range(int(input())):
	ans += -eval('-'.join(input().split())) >= 2
print(ans)


s = 0
for _ in range(int(input())):
	(p, q) = map(int, input().split())
	if q - p > 1:
		s += 1
print(str(s))


n = int(input(''))
count = 0
for i in range(n):
	(p_i, q_i) = map(int, input('').split())
	diff = q_i - p_i
	if diff >= 2:
		count += 1
print(count)


rooms = int(input())
lst = []
for i in range(rooms):
	lst.append(list(map(int, input().split(' '))))
count = 0
for i in lst:
	if i[0] <= i[1] - 2:
		count += 1
print(count)


n = int(input())
d = 0
for i in range(0, n):
	a = input()
	s = a.index(' ')
	p = a[:s]
	q = a[s + 1:]
	p = int(p)
	q = int(q)
	c = q - p
	if c >= 2:
		d = d + 1
print(d)


print(len([n for n in [abs(eval('-'.join(input().split()))) for i in range(int(input()))] if n > 1]))


n = int(input())
count = 0
for t in range(0, n):
	inp = input().split()
	p = int(inp[0])
	q = int(inp[1])
	if q - p >= 2:
		count += 1
print(count)


n = int(input())
list_x = []
list_y = []
for i in range(n):
	(x, y) = list(map(int, input().split()))
	list_x.append(x)
	list_y.append(y)
count = 0
for j in range(n):
	subtract = list_y[j] - list_x[j]
	if subtract >= 2:
		count = count + 1
	else:
		continue
print(count)


N = int(input())
final = 0
for i in range(N):
	d = input()
	d = d.split(' ')
	if int(d[1]) - int(d[0]) >= 2:
		final += 1
print(final)


rooms = 0
for i in range(int(input())):
	s = list(map(int, input().split()))
	if s[0] != s[1] and max(s[0], s[1]) - min(s[0], s[1]) >= 2:
		rooms += 1
print(rooms)


n = int(input())
ans = 0
for i in range(n):
	cmd = input()
	lst = cmd.split()
	people = int(lst[0])
	capacity = int(lst[1])
	if capacity - people >= 2:
		ans += 1
print(ans)


try:
	x = int(input())
	cnt = 0
	for i in range(x):
		(a, b) = map(int, input().split())
		if b - a > 1:
			cnt += 1
	print(cnt)
except:
	pass


nRooms = int(input())
availableRooms = 0
for i in range(nRooms):
	(pi, qi) = input().split()
	pi = int(pi)
	qi = int(qi)
	if qi - pi >= 2:
		availableRooms += 1
print(availableRooms)


N = int(input())
V = 0
for k in range(N):
	L = input()
	L = L.split()
	A = int(L[0])
	B = int(L[1])
	D = B - A
	if D >= 2:
		V += 1
print(V)


def accomodate(living, can_live, rooms):
	cnt = 0
	for i in range(0, rooms):
		if can_live[i] - living[i] >= 2:
			cnt += 1
	print(cnt)
rooms = int(input())
(living, can_live) = ([], [])
for i in range(rooms):
	(a, b) = map(int, input().split())
	living.append(a)
	can_live.append(b)
accomodate(living, can_live, rooms)


n = int(input())
num_rooms = 0
for i in range(n):
	(raw_pi, raw_qi) = input().split()
	pi = int(raw_pi)
	qi = int(raw_qi)
	if qi - pi >= 2:
		num_rooms += 1
print(num_rooms)


num = int(input())
res = 0
for x in range(0, num):
	r = list(input().split())
	p = int(r[0])
	q = int(r[1])
	if q - p >= 2:
		res = res + 1
print(res)


n = int(input())
res = 0
for i in range(n):
	(p, max_p) = map(int, input().split())
	if max_p - p > 1:
		res += 1
print(res)


n = int(input())
c = 0
d = 0
while c != n:
	(a, b) = input().split()
	(a, b) = (int(a), int(b))
	if a < b - 1:
		d = d + 1
	else:
		pass
	c = c + 1
print(d)


try:
	t = int(input())
	i = 0
	count = 0
	while i < t:
		(p, q) = list(map(int, input().split()))
		if q - p >= 2:
			count += 1
		i += 1
	print(count)
except:
	pass


n = int(input())
ans = 0
while n > 0:
	(a, b) = map(int, input().split())
	if b - a > 1:
		ans += 1
	n -= 1
print(ans)


lines = int(input())
sum = 0
for i in range(lines):
	(p, q) = map(int, input().split())
	if q - p >= 2:
		sum += 1
print(sum)


n = int(input())
j = 0
for i in range(n):
	ci = input().split()
	if int(ci[1]) - int(ci[0]) >= 2:
		j += 1
print(j)


n = int(input())
count = 0
for i in range(n):
	(first, last) = map(int, input().split())
	if last - first >= 2:
		count += 1
print(count)


a = int(input())
i = 0
p = 0
while i < a:
	c = [int(i) for i in input().split(' ')]
	if c[1] - c[0] > 1:
		p += 1
	i += 1
print(p)


re = 0
for _ in range(int(input())):
	s = list(map(int, str(input()).split(' ')))
	if s[1] - s[0] >= 2:
		re += 1
print(re)


t = int(input())
ouns = 0
for i in range(t):
	found = input().split(' ')
	a = int(found[0])
	b = int(found[1])
	if a + 2 <= b:
		ouns = ouns + 1
print(ouns)


N = int(input())
c = 0
for i in range(N):
	(A, B) = map(int, input().split())
	if B - A >= 2:
		c += 1
print(c)


import sys
rooms = 0
input()
for line in sys.stdin:
	nums = line.strip().split(' ')
	nums = [int(n) for n in nums if not n == '']
	if nums[1] - nums[0] >= 2:
		rooms += 1
print(rooms)


n = int(input())
c = 0
for i in range(n):
	inp = input()
	inpL = inp.split(' ')
	p = int(inpL[0])
	q = int(inpL[1])
	if q - p > 1:
		c = c + 1
print(c)


i = int(input())
num_rooms = 0
while i > 0:
	d = list(input().split())
	if int(d[1]) - int(d[0]) >= 2:
		num_rooms += 1
	i -= 1
print(num_rooms)


n = int(input())
count = 0
for i in range(n):
	(no_of_rooms, no_of_people) = map(int, input().split())
	if no_of_rooms == no_of_people:
		continue
	elif no_of_rooms < no_of_people and no_of_people - no_of_rooms >= 2:
		count += 1
	else:
		continue
print(count)


n = int(input())
l = list()
ss = list()
for i in range(n):
	(s1, s2) = map(int, input().split(' '))
	l.append([s1, s2])
i = 0
for ss in l:
	if ss[1] - ss[0] > 1:
		i += 1
print(i)


TN = 1

def solution():
	n = int(input())
	ans = 0
	for i in range(n):
		(p, q) = map(int, input().split())
		if q - p >= 2:
			ans += 1
	print(ans)
while TN != 0:
	solution()
	TN -= 1


s = 0
for i in range(int(input())):
	(a, b) = map(int, input().split())
	s += b - a >= 2
print(s)


k = 0
for _ in range(int(input())):
	k += eval(input().replace(' ', '-')) < -1
print(k)


t = int(input())
c = 0
for i in range(t):
	x = list(map(int, input().strip().split()))
	if x[1] - x[0] >= 2:
		c = c + 1
print(c)


a = 0
for i in range(int(input())):
	lt = input().split()
	if int(lt[0]) <= int(lt[1]) - 2:
		a += 1
print(a)


mas = 0
for _ in range(int(input())):
	(p, q) = [int(x) for x in input().split()]
	if p + 2 <= q:
		mas += 1
print(mas)


number = int(input(''))
count = 0
for i in range(number):
	(first_number, second_number) = input(' ').split(' ')
	one = int(first_number)
	two = int(second_number)
	if one + 1 < two:
		count += 1
print(count)


count = 0
t = int(input())
for i in range(t):
	test = input().split(' ')
	if int(test[1]) - int(test[0]) >= 2:
		count += 1
print(count)


n = int(input())
counter = 0
for i in range(n):
	(a, b) = map(int, input().strip().split(' '))
	if b - a > 1:
		counter += 1
print(counter)


nrOfRooms = int(input())
rooms = 0
for i in range(nrOfRooms):
	(x, y) = map(int, input().split())
	if y - x >= 2:
		rooms += 1
print(rooms)


def _467A(rooms):
	return list(map(lambda x: x[1] - x[0] > 1, rooms)).count(True)
number = int(input())
rooms = []
for index in range(number):
	rooms.append(list(map(lambda x: int(x), input().split())))
print(_467A(rooms))


m = []
a = 0
for _ in range(int(input())):
	m.append([int(i) for i in input().split(' ')])
	if m[len(m) - 1][1] - m[len(m) - 1][0] - 2 >= 0:
		a += 1
print(a)


l = int(input())
m = []
ans = 0
for i in range(l):
	a = input()
	m = a.split(' ')
	if int(m[1]) - int(m[0]) >= 2:
		ans += 1
print(str(ans))


a = int(input())
c = 0
for i in range(a):
	(p, h) = input().split()
	(p, h) = (int(p), int(h))
	if p < h - 1:
		c += 1
print(c)


n = int(input())
lst = [list(map(int, input().split())) for _ in range(0, n)]
counter = 0
for row in lst:
	if row[1] - row[0] >= 2:
		counter += 1
print(counter)


n = int(input(''))
count = 0
for i in range(n):
	(p, v) = [int(x) for x in input('').split()]
	if v - p >= 2:
		count += 1
print(count)


n = int(input())
c = 0
for x in range(n):
	(people, cap) = map(int, input().split())
	if people != cap:
		if abs(cap - people) >= 2:
			c = c + 1
print(c)


k = int(input())
c = 0
for i in range(k):
	(j, k) = list(map(int, input().rstrip().split()))
	if abs(j - k) >= 2:
		c += 1
print(c)


LIMIT = int(input())
count = 0
for _ in range(LIMIT):
	(occupied, capacity) = map(int, input().split())
	if capacity - occupied >= 2:
		count += 1
print(count)


def main():
	n = int(input())
	count = 0
	for _ in range(n):
		(p, q) = map(int, input().split())
		if q - p >= 2:
			count = count + 1
	print(count)
while True:
	try:
		main()
	except EOFError:
		break


A = int(input())
i = 0
C = 0
while A:
	(t1, t2) = map(int, input().split())
	if t2 - t1 >= 2:
		C += 1
	A -= 1
print(C)


def main():
	N = int(input())
	res = 0
	for i in range(N):
		x = [int(y) for y in input().split()]
		if x[1] - x[0] >= 2:
			res += 1
	print(res)
main()


n = int(input())
occupancy_count = 0
for x in range(n):
	string = list(map(int, input().split()))
	if string[1] - string[0] >= 2:
		occupancy_count += 1
print(occupancy_count)


n = int(input())
p = []
q = []
for i in range(n):
	string = input()
	new_list = string.split()
	p.append(int(new_list[0]))
	q.append(int(new_list[1]))
count = 0
for i in range(n):
	if q[i] - p[i] >= 2:
		count += 1
print(count)


number = int(input())
check = 0

def available(num):
	if int(num[1]) - int(num[0]) >= 2:
		return 1
	else:
		return 0
while number > 0:
	check += available(input().split())
	number -= 1
print(check)


n = int(input())
a = [list(map(int, input().split())) for i in range(n)]
print(sum((1 for i in a if i[1] - i[0] > 1)))


num = int(input())
total = 0
for x in range(num):
	room_cap = input().split()
	current = int(room_cap[0])
	cap = int(room_cap[1])
	if cap - current >= 2:
		total += 1
print(total)


num_rooms = int(input())
info = []
for i in range(num_rooms):
	info.append(input())
count = 0
for room in info:
	room = room.split(' ')
	p = int(room[0])
	q = int(room[1])
	delta = q - p
	if delta >= 2:
		count += 1
print(count)


count = 0
for t in range(int(input())):
	(m, n) = map(int, input().split())
	if n - m > 1:
		count += 1
print(count)


l = lambda : map(int, input().split())
n = int(input())
numlist = []
for i in range(n):
	num = list(l())
	numlist.append(num)
cnt = 0
for i in numlist:
	if i[1] - i[0] >= 2:
		cnt += 1
print(cnt)


def dormitory():
	n = int(input())
	flag = 0
	i = 0
	if 1 <= n <= 100:
		while i < n:
			(p, q) = input().split(' ')
			p = int(p)
			q = int(q)
			if p + 2 <= q:
				flag = flag + 1
			i = i + 1
		print(flag)
	else:
		print('Bad Entry')
dormitory()


pq = [tuple(map(int, input().split())) for _ in range(int(input()))]
result = sum((1 if q - p >= 2 else 0 for (p, q) in pq))
print(result)


n = int(input())
c = 0
while n:
	(live, capacity) = map(int, input().split())
	rem = capacity - live
	if rem >= 2:
		c += 1
	n -= 1
print(c)


rooms = int(input())
capacity = []
for i in range(rooms):
	capacity.append(input().split())
for i in range(len(capacity)):
	for j in range(len(capacity[i])):
		capacity[i][j] = int(capacity[i][j])
howManyRooms = 0
for i in range(len(capacity)):
	for j in range(len(capacity[i])):
		if capacity[i][j + 1] - capacity[i][j] >= 2:
			howManyRooms += 1
			break
		else:
			break
print(howManyRooms)


s = int(input())
count = 0
for i in range(s):
	lst = input()
	lst1 = lst.split(' ')
	if int(lst1[0]) < int(lst1[1]) and int(lst1[1]) - int(lst1[0]) >= 2:
		count += 1
print(count)


n = int(input())
list_a = []
list_b = []
for _ in range(n):
	(a, b) = map(int, input().split())
	list_a.append(a)
	list_b.append(b)
difference = []
zip_object = zip(list_a, list_b)
for (list1_i, list2_i) in zip_object:
	difference.append(list2_i - list1_i)
count = sum(map(lambda x: x >= 2, difference))
print(count)


def main():
	userInp = int(input())
	room = 0
	for i in range(userInp):
		(p, q) = list(map(int, input().split()))
		if q - p >= 2:
			room += 1
	print(room)
main()


x = int(input())
z = [tuple(map(int, input().split())) for _ in range(x)]
i = 0
for tup in z:
	if tup[0] + 2 <= tup[1]:
		i += 1
print(i)


n = int(input(''))
p = []
q = []
for i in range(n):
	inp = list(map(int, input('').split()))
	p.append(inp[0])
	q.append(inp[1])
counter = sum([1 for j in range(n) if q[j] - p[j] >= 2])
print(counter)


x = int(input())
l = 0
g = []
for n in range(x):
	s = [int(n) for n in input().split()]
	g.append(s[1] - s[0])
	s = []
print(x - g.count(1) - g.count(0))


n = int(input())
roomList = []
for i in range(n):
	roomList.append(list(map(int, input().strip().split(' '))))
vacant = 0
for room in roomList:
	if room[1] - room[0] >= 2:
		vacant += 1
print(vacant)


number_of_rooms = input('')
output = 0
for i in range(int(number_of_rooms)):
	(a, b) = input('').split()
	if int(b) - int(a) >= 2:
		output = output + 1
print(output)


t = int(input())
c = 0
for h in range(t):
	(p, q) = list(map(int, input().split()))
	if q - p > 1:
		c += 1
print(c)


noOfRooms = 0
for _ in range(int(input())):
	(occupied, total) = map(int, input().split())
	noOfRooms += 1 if total - occupied >= 2 else 0
print(noOfRooms)


from sys import stdin
n = int(stdin.readline())
summa = 0
for x in range(n):
	line = [int(y) for y in stdin.readline().split()]
	if line[1] - line[0] >= 2:
		summa += 1
print(summa)


n = int(input())
print(sum([1 for _ in range(n) if (lambda i: int(i[1]) - int(i[0]) > 1)(input().split())]))


print(len([1488 for _ in range(int(input())) if (lambda xuy: int(xuy[1]) - int(xuy[0]) >= 2)(input().split())]))


n = int(input())
su = 0
for x in range(n):
	(c, d) = map(int, input().split())
	if d - c >= 2:
		su += 1
print(su)


n = input()
count = 0
for i in range(int(n)):
	(currentPeople, totalPeople) = input().split(' ')
	if int(totalPeople) - int(currentPeople) >= 2:
		count = count + 1
print(count)


n = int(input())
i = 0
k = 0
while i <= n - 1:
	s = input().split()
	a = int(s[0])
	b = int(s[1])
	if a + 2 <= b:
		k = k + 1
	i = i + 1
print(k)


available = 0
for _ in range(int(input())):
	(living, capacity) = map(int, input().split())
	if capacity - living >= 2:
		available += 1
print(available)


n = int(input())
count = 0
while n != 0:
	(currently_living, capacity) = input().split()
	currently_living = int(currently_living)
	capacity = int(capacity)
	if capacity - currently_living >= 2:
		count += 1
	n -= 1
print(count)


ted = int(input())
b = 0
for i in range(ted):
	a = input()
	list = a.split(' ')
	if int(list[1]) - int(list[0]) >= 2:
		b += 1
print(b)


a = int(input())
sum = 0
for k in range(a):
	b = list(map(int, input().strip().split(' ')))
	if b[1] - b[0] >= 2:
		sum += 1
print(sum)


n = int(input())
count = 0
for _ in range(n):
	(i, j) = map(int, input().split())
	if j - i >= 2:
		count += 1
print(count)


n = int(input())
res = 0
for x in range(n):
	(cur, max) = map(int, input().split())
	if max - cur >= 2:
		res += 1
print(res)


from sys import stdin
n = int(stdin.readline())
cont = 0
for i in range(n):
	x = [int(x) for x in stdin.readline().split()]
	if x[1] - x[0] >= 2:
		cont += 1
print(cont)


n = int(input())
enough_rooms = 0
for room in range(n):
	(roomer, common) = (int(data) for data in input().split())
	if common - roomer >= 2:
		enough_rooms = enough_rooms + 1
print(enough_rooms)


Sum = 0
for i in range(int(input())):
	(p, q) = map(int, input().split())
	Sum += q - p >= 2
print(Sum)


n = int(input())
ans = 0
for i in range(n):
	(a, b) = [int(tmp) for tmp in input().split()]
	if b - a >= 2:
		ans += 1
print(ans)


n = int(input())
tot = 0
for i in range(0, n):
	arr = input().split(' ')
	a = int(arr[0])
	b = int(arr[1])
	if b - a >= 2:
		tot += 1
print(tot)


n = input()
input_ = []
roomspace = []
people_num = []
for i in range(int(n)):
	input_.append(input().split(' '))
	roomspace.append(input_[0][1])
	people_num.append(input_[0][0])
	input_.clear()
num = 0
list = map(lambda a, b: eval(a) - eval(b), roomspace, people_num)
for item in list:
	if item >= 2:
		num += 1
print(num)


class Accom:

	def __init__(self, arr, n):
		self.a = arr
		self.n = n
		self.count = 0

	def check(self):
		for i in range(self.n):
			if self.a[i][0] + 1 < self.a[i][1]:
				self.count += 1
		return self.count

def main():
	n = int(input())
	arr = []
	for i in range(n):
		arr.append(list(map(int, input().split())))
	re = Accom(arr, n)
	print(re.check())
main()


import sys
a = sys.stdin.readline()
cont = 0
for i in range(int(a)):
	s = sys.stdin.readline().split()
	if int(s[1]) - int(s[0]) >= 2:
		cont += 1
print(cont)


t = int(input())
l = list()
c = 0
for _ in range(t):
	l.append(input().split())
for i in l:
	if int(i[1]) - int(i[0]) >= 2:
		c += 1
print(c)


n = int(input())
count = 0
for m in range(0, n):
	(p, q) = map(int, input().split())
	if q - p >= 2:
		count += 1
	else:
		continue
print(count)


num_rooms = int(input())
count = 0
for i in range(num_rooms):
	(people, max) = [int(x) for x in input().split()]
	if max - people >= 2:
		count += 1
print(count)


room_amount = int(input())
all_rooms = []
for room in range(room_amount):
	avalible = input()
	alist = avalible.split(' ')
	all_rooms.append(alist)
for dorm in range(len(all_rooms)):
	all_rooms[dorm] = list(map(int, all_rooms[dorm]))
rooms_avalible = 0
for dormitory in all_rooms:
	if dormitory[1] - dormitory[0] >= 2:
		rooms_avalible += 1
print(rooms_avalible)


import math
x = int(input())
count = 0
for i in range(x):
	maxi = [int(x) for x in input().split()]
	if maxi[1] - maxi[0] >= 2:
		count += 1
print(count)


n = int(input())
cntr = 0
for _ in range(n):
	a = input().split()
	if int(a[1]) - int(a[0]) >= 2:
		cntr += 1
print(cntr)


K = int(input())
friends = 2
approach = 0
for i in range(K):
	(a, b) = map(int, input().split())
	places = b - a
	if places >= friends:
		approach += 1
print(approach)


rooms_num = int(input())
answer = 0
for i in range(rooms_num):
	(num, cap) = map(int, input().split())
	if cap - num >= 2:
		answer += 1
print(answer)


q = int(input())
room = []
flag = 0
for i in range(q):
	data = list(map(int, input().split()))
	room.append(data)
for i in range(q):
	if room[i][1] - room[i][0] >= 2:
		flag += 1
print(flag)


room_count = int(input())
count = 0
for i in range(room_count):
	(lived_person, capacity) = map(int, input().split())
	if capacity - lived_person >= 2:
		count += 1
print(count)


n = int(input())
s = 0
for i in range(n):
	(a, b) = [int(x) for x in input().split(' ')]
	s += 1 if b - a > 1 else 0
print(s)


n = int(input())
zero = 0
(lisp, lisq) = ([], [])
for i in range(n):
	(p, q) = map(int, input().split())
	lisp.append(p)
	lisq.append(q)
	if lisp[i] != lisq[i] and lisq[i] - lisp[i] >= 2:
		zero += 1
print(zero)


import sys

class Scanner:

	def __init__(self):
		self.current_tokens = []

	def remaining_tokens(self):
		return len(self.current_tokens)

	def nextline(self):
		assert self.remaining_tokens() == 0, 'Reading next line with remaining tokens'
		return input()

	def nexttokens(self):
		return self.nextline().split()

	def nexttoken(self):
		if len(self.current_tokens) == 0:
			self.current_tokens = self.nexttokens()
		assert self.remaining_tokens() > 0, 'Not enough tokens to parse.'
		return self.current_tokens.pop(0)

	def nextints(self, n=-1):
		if n == -1:
			return list(map(int, self.nexttokens()))
		else:
			return (self.nextint() for i in range(n))

	def nextint(self):
		return int(self.nexttoken())

def quit():
	sys.exit(0)
stdin = Scanner()
nextint = stdin.nextint
nextints = stdin.nextints
nextline = stdin.nextline
n = nextint()
c = 0
for i in range(n):
	(p, q) = nextints(2)
	if q - p >= 2:
		c += 1
print(c)


t = int(input())
list = []
answer = 0
for i in range(t):
	(p, q) = map(int, input().split())
	if q - p >= 2:
		answer += 1
print(answer)


a = int(input())
t = 0
for i in range(a):
	q = input()
	q = q.split()
	if int(q[1]) > int(q[0]) + 1:
		t = t + 1
print(t)


n = int(input())
ans = 0
for i in range(n):
	(pi, qi) = map(int, input().split())
	if qi - pi > 1:
		ans += 1
print(ans)


t = int(input())
c = 0
for i in range(t):
	x = input().split()
	x = [int(x[l]) for l in range(2)]
	if abs(x[0] - x[1]) >= 2:
		c += 1
	else:
		continue
print(c)


g = int(input(''))
u = 0
for i in range(g):
	xList = [int(x) for x in input('').split()]
	if xList[1] - xList[0] >= 2:
		u += 1
print(u)


numberRooms = int(input())
spaceAlexGeorge = 0
for i in range(0, numberRooms):
	(roomLiving, roomCapacity) = input().split()
	roomLiving = int(roomLiving)
	roomCapacity = int(roomCapacity)
	if roomCapacity - roomLiving >= 2:
		spaceAlexGeorge += 1
print(spaceAlexGeorge)


count = 0
rooms = int(input())
sit = [list(map(int, input().strip().split())) for i in range(rooms)]
for i in range(rooms):
	for j in range(1):
		if sit[i][j + 1] - sit[i][j] >= 2:
			count += 1
print(count)


n = int(input())
c = 0
while n != 0:
	(p, q) = input().split()
	(p, q) = (int(p), int(q))
	a = abs(p - q)
	if a > 2 or a == 2:
		c += 1
	n -= 1
print(c)


from sys import stdin
_input = stdin.readline
(_range, _int) = (range, int)

def solution():
	ans = 0
	for _ in _range(_int(_input())):
		(n, k) = [_int(i) for i in _input().split()]
		if k - n >= 2:
			ans += 1
	print(ans)
solution()


def check(pi, qi):
	if qi - pi >= 2:
		return 1
	else:
		return 0
n = int(input())
c = 0
for i in range(n):
	[pi, qi] = map(int, input().split())
	c += check(pi, qi)
print(c)


n = int(input())
cnt = 0
for _ in range(n):
	if abs(eval(input().replace(' ', '-'))) >= 2:
		cnt += 1
print(cnt)


count = 0
t = int(input())
while t:
	(p, q) = map(int, input().split())
	if p < q and abs(p - q) >= 2:
		count = count + 1
	t = t - 1
print(count)


try:
	n = int(input())
	count = 0
	while n:
		(l, c) = map(int, input().split())
		if c - l >= 2:
			count += 1
		n -= 1
	print(count)
except:
	pass


free = 0
for x in range(int(input())):
	(p, q) = map(int, input().split())
	if q - p > 1:
		free = free + 1
print(free)


n = int(input())
a = [list(map(int, input().split())) for i in range(n)]
c = 0
for i in range(n):
	if a[i][0] < a[i][1] and a[i][1] - a[i][0] > 1:
		c = c + 1
print(c)


__author__ = 'sonerik'
import sys
inp = sys.stdin
n = int(inp.readline())
free = 0
for line in inp:
	(p, q) = map(int, line.strip().split())
	if q - p >= 2:
		free += 1
print(free)


ans = 0
for x in range(int(input())):
	a = input().split()
	if int(a[1]) - int(a[0]) > 1:
		ans += 1
print(ans)


n_rooms = int(input())
rooms = [[int(x), int(y)] for (x, y) in [input().split() for i in range(n_rooms)]]
answer = 0

def diff(lis):
	global answer
	if lis[1] - lis[0] >= 2:
		answer += 1
list(map(diff, rooms))
print(answer)


n = int(input())
count = 0
for i in range(n):
	string = input().split(' ')
	spaceLeft = int(string[1]) - int(string[0])
	if spaceLeft >= 2:
		count += 1
print(count)


n = int(input())
s = ''
for i in range(n):
	s += input()
	s += ' '
a = s.split()
k = 0
for i in range(0, len(a), 2):
	if int(a[i + 1]) - int(a[i]) >= 2:
		k += 1
	else:
		k += 0
print(k)


import math
n = int(input())
total = 0
for i in range(n):
	(x, y) = map(int, input().split(' '))
	if y - x >= 2:
		total += 1
print(total)


lim = int(input())
c = 0
for i in range(lim):
	nums = list(map(int, input().split(' ')))
	diff = nums[1] - nums[0]
	if diff >= 2:
		c += 1
print(c)


def find_room(rooms):
	rooms = int(rooms)
	count = 0
	for i in range(0, rooms):
		(num_peop, capacity) = map(int, input().split())
		if capacity - num_peop >= 2:
			count += 1
	return count
rooms = input()
print(find_room(rooms))


roomd = input()
roomn = int(roomd)
x = 1
count = 0
while x <= roomn:
	room = input()
	x += 1
	rooml = room.split()
	roomp = int(rooml[0])
	roomc = int(rooml[1])
	if roomc - roomp >= 2:
		count += 1
print(count)


import math
z = int(input())
c = 0
for i in range(z):
	(a, b) = map(int, input().split())
	if b - a >= 2:
		c += 1
print(c)


c = 0
for _ in range(int(input())):
	n = [int(x) for x in input().split()]
	(n, m) = (n[0], n[1])
	if m - n >= 2:
		c += 1
print(c)


n = int(input())
hah = 0
while n > 0:
	(people, cap) = map(int, input().split())
	if cap - people >= 2:
		hah += 1
	n -= 1
print(hah)


n = int(input())
dope = 0
for i in range(n):
	(h, m) = map(int, input().split())
	if m - h >= 2:
		dope += 1
print(dope)


count = 0
for i in range(int(input())):
	temp = [int(j) for j in input().split()]
	if temp[1] - temp[0] >= 2:
		count += 1
print(count)


def room(p, q):
	q = q - p
	i = 0
	if q >= 2:
		i = 1
	return i
n = int(input())
i = 0
while n > 0:
	n -= 1
	(p, q) = map(int, input().split())
	if room(p, q):
		i += 1
print(i)


def rooms(a, b):
	if b - a >= 2:
		return 1
	else:
		return 0
t = int(input())
z = 0
for i in range(t):
	(a, b) = map(int, input().split())
	s = rooms(a, b)
	z = z + s
print(z)


r = int(input())
c = 0
for i in range(r):
	arr = input().split()
	if int(arr[0]) + 2 <= int(arr[1]):
		c += 1
print(c)


x = int(input())
c = 0
for i in range(x):
	l = list(map(int, input().split()))
	if l[0] < l[1] - 1:
		c += 1
print(c)


n = int(input())
num = 0
t = 0
while t < n:
	(p, q) = map(int, input().split())
	if p <= q - 2:
		num = num + 1
	else:
		num = num
	t = t + 1
print(num)


n = int(input())
num_rooms = 0
for i in range(n):
	line = input().split()
	p = int(line[0])
	q = int(line[1])
	if q - p >= 2:
		num_rooms += 1
print(num_rooms)


door = int(input())
res = 0
for i in range(door):
	capC = list(input().split(' '))
	chck = int(capC[1]) - int(capC[0])
	if chck >= 2:
		res += 1
print(res)


a = int(input())
count = 0
for i in range(a):
	(j, k) = map(int, input().split())
	if k - j >= 2:
		count += 1
	else:
		pass
print(count)


cnt = 0
for _ in range(int(input())):
	(men, cap) = map(int, input().split())
	if men <= cap - 2:
		cnt += 1
print(cnt)


a = int(input())
c = 0
for i in range(a):
	(n, q) = map(int, input().split())
	if q - n >= 2:
		c = c + 1
print(c)


options = 0
for ___ in range(int(input())):
	(people, fit) = [int(a) for a in input().split()]
	if people + 2 <= fit:
		options += 1
print(options)


_1 = '236a'
_2 = '339a'
_3 = '266a'
_4 = '96a'
_5 = '236a'
_6 = '281a'
_7 = '546a'
_8 = '116a'
_9 = '977a'
_10 = '266b'
_11 = '110a'
_12 = '41a'
_13 = '734a'
_14 = '133a'
_15 = '467a'
count = 0
n = int(input())
l = [list(map(int, input().split())) for i in range(n)]
for i in range(len(l)):
	if l[i][1] - l[i][0] >= 2:
		count += 1
print(count)


rooms = int(input())
count = 0
for i in range(rooms):
	(a, b) = map(int, input().split(' '))
	if a < b and b - a >= 2:
		count += 1
print(count)


def accomdation(rooms):
	count = 0
	for rom in rooms:
		if rom[1] - rom[0] >= 2:
			count += 1
	return count
n = int(input())
rooms = []
for _ in range(n):
	room = list(map(int, input().split(' ')))
	rooms.append(room)
print(accomdation(rooms))


n = int(input())
s = 0
for _ in range(1, n + 1):
	m = map(int, input().split())
	for i in m:
		for j in m:
			if j - i >= 2:
				s += 1
print(s)


rooms = int(input())
a = 0
for i in range(0, rooms):
	s = input()
	(o, t) = map(int, s.split())
	b = t - o
	if b >= 2:
		a += 1
print(a)


n = int(input())
alpha = 0
for _ in range(n):
	(p, q) = [int(x) for x in input().split()]
	if abs(q - p) >= 2:
		alpha += 1
	else:
		continue
print(alpha)


n = int(input())
l = list()
k = 0
for i in range(n):
	p = list(map(int, input().split()))
	l.append(p)
n = 0
for i in range(len(l)):
	k = l[i][1] - l[i][0]
	if k >= 2:
		n = n + 1
	else:
		continue
print(n)


n = int(input())
A = []
cn = 0
for i in range(n):
	A.append(list(map(int, input().split())))
for i in range(n):
	if A[i][1] - A[i][0] > 1:
		cn += 1
print(cn)


from collections import deque
import math
answer = 0
for n in range(int(input())):
	(p, q) = map(int, input().split())
	if q - p >= 2:
		answer += 1
print(answer)


from math import ceil, sqrt, gcd

def ii():
	return int(input())

def si():
	return input()

def mi():
	return map(int, input().strip().split(' '))

def li():
	return list(mi())
t = ii()
c = 0
while t:
	t -= 1
	(a, b) = mi()
	if b - a >= 2:
		c += 1
print(c)


n = int(input())
p = [0] * n
q = [0] * n
m = []
nu = 0
for i in range(n):
	(p[i], q[i]) = [int(k) for k in input().split()]
for i in range(n):
	m.append(q[i] - p[i])
for i in range(n):
	if m[i] >= 2:
		nu += 1
print(nu)


total_room = int(input())
can_stay = 0
for i in range(total_room):
	room = input().split(' ')
	if int(room[1]) >= int(room[0]) + 2:
		can_stay += 1
print(can_stay)


h = 0
for x in range(int(input())):
	(p, q) = input().split()
	if int(q) - int(p) >= 2:
		h += 1
print(h)


import sys
input = sys.stdin.readline

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())
l = []
n = inp()
for i in range(n):
	li = inlt()
	l.append(li)
m = 0
for item in l:
	if item[1] - item[0] >= 2:
		m += 1
print(m)


def cf_467a():
	rooms = int(input())
	count = 0
	for _ in range(rooms):
		(p, q) = map(int, input().split())
		if q - p >= 2:
			count += 1
	print(count)
cf_467a()


n = int(input())
i = 0
true = 0
while i < n:
	(a, b) = list(map(int, input().split()))
	c = b - a
	if c >= 2:
		true += 1
	i += 1
print(true)


value = int(input())
num = 0
for i in range(value):
	values = input()
	(a, b) = values.split()
	a = int(a)
	b = int(b)
	if b - a > 1:
		num += 1
print(num)


t = int(input())
count = 0
for x in range(t):
	(q, p) = map(int, input().split())
	if p - q >= 2:
		count += 1
print(count)


n = int(input())
out = []
for i in range(n):
	(a, b) = [int(s) for s in input().split()]
	x = b - a
	if x >= 2:
		out.append(x)
print(len(out))


n = int(input())
avaible = 0
for i in range(n):
	(live, canlive) = map(int, input().split())
	if canlive - live >= 2:
		avaible += 1
print(avaible)


n = int(input())
x = 0
for i in range(n):
	(p1, q1) = input().split()
	p1 = int(p1)
	q1 = int(q1)
	if q1 - p1 >= 2:
		x += 1
print(x)


n = int(input())
rooms = []
ok = 0
for x in range(n):
	a = list(map(int, input().split()))
	rooms.append(a)
for i in rooms:
	if i[1] - i[0] >= 2:
		ok += 1
print(ok)


n = int(input())
ans = 0
for i in range(n):
	pq = tuple(map(int, input().split()))
	if pq[1] - pq[0] >= 2:
		ans += 1
print(ans)


N = int(input())
i = 0
s = 0
while i < N:
	(m, n) = map(int, input().split())
	if n - m >= 2:
		s += 1
	i += 1
print(s)


n = int(input())
arr = []
for _ in range(n):
	arr.append(list(map(int, input().split())))
ans = 0
for i in arr:
	if i[1] - i[0] >= 2:
		ans += 1
print(ans)


num = int(input().strip())
count = 0
for i in range(num):
	(p, q) = input().split(' ')
	p = int(p)
	q = int(q)
	if abs(p - q) >= 2:
		count += 1
print(count)


import os
import sys
from math import *
from collections import *
from fractions import *
from bisect import *
from heapq import *
from io import BytesIO, IOBase

def vsInput():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def value():
	return tuple(map(int, input().split()))

def array():
	return [int(i) for i in input().split()]

def Int():
	return int(input())

def Str():
	return input()

def arrayS():
	return [i for i in input().split()]
ans = 0
for _ in range(int(input())):
	(a, b) = value()
	ans += b - a >= 2
print(ans)


n = int(input())
answer = 0
for i in range(n):
	line = input().split()
	if int(line[0]) <= int(line[1]) - 2:
		answer += 1
print(answer)


resp = 0
for ni in range(int(input())):
	(pi, qi) = map(int, input().split())
	if qi - pi >= 2:
		resp += 1
print(resp)


n = int(input())
dorm = []
for i in range(n):
	dorm.append(list(map(int, input().split())))
print(sum([i[1] - i[0] >= 2 for i in dorm]))


cap = int(input())
rooms = []
for i in range(cap):
	rooms.append(list(map(int, str(input()).split(' '))))
ok = 0
for r in rooms:
	if r[1] - r[0] >= 2:
		ok += 1
print(ok)


try:
	n = int(input())
	ci = 0
	for i in range(n):
		(p, c) = map(int, input().split())
		if c - p >= 2:
			ci += 1
	print(ci)
except:
	pass


n = int(input())
number_available = 0
str1 = None
p = None
q = None
for i in range(1, n + 1, 1):
	str1 = input().split()
	p = int(str1[0])
	q = int(str1[1])
	if q - p >= 2:
		number_available += 1
print(number_available)


n = int(input())
counter = 0
for i in range(n):
	(current, limit) = map(int, input().split())
	if limit - current > 1:
		counter += 1
print(counter)


t = int(input())
c = 0
for j in range(t):
	(p, q) = input().split(' ')
	(p, q) = (int(p), int(q))
	if p + 2 <= q:
		c += 1
print(c)


def func():
	room_no = input()
	dict = {}
	val = []
	for d in range(int(room_no)):
		temp = input()
		val = temp.split(' ')
		dict[d] = []
		for k in range(2):
			dict[d].append(val[k])
	cnt = 0
	for d in range(len(dict)):
		if int(dict[d][1]) - int(dict[d][0]) >= 2:
			cnt = cnt + 1
	print(cnt)
func()


R = lambda : map(int, input().split())
n = int(input())
count = 0
for i in range(0, n):
	(r, c) = list(R())
	if c - r >= 2:
		count += 1
print(count)


n = int(input())
s = [tuple(map(int, input().split(' '))) for x in range(n)]
m = sum([1 for x in s if x[1] - x[0] > 1])
print(m)


banyak = int(input())
total = 0
for i in range(banyak):
	masukan = input().split()
	p = int(masukan[0])
	q = int(masukan[1])
	if q - p >= 2:
		total += 1
print(total)


n = int(input())
print([x[1] - x[0] >= 2 for x in [list(map(int, input().split())) for i in range(n)]].count(True))


r = 0
for i in range(int(input())):
	a = list(map(int, input().split()))
	r += a[1] - a[0] >= 2
print(r)


n = int(input())
count = 0
list1 = []
for i in range(n):
	list1.append(list(map(int, input().strip().split(' '))))
for i in list1:
	if abs(i[0] - i[1]) >= 2:
		count += 1
print(count)


data = []
n = int(input())
for i in range(n):
	(a, b) = input().split()
	a = int(a)
	b = int(b)
	ab = [a, b]
	data += [ab]
summa = 0
for i in data:
	rez = i[1] - i[0]
	if rez > 1:
		summa += 1
print(summa)


c = 0
for _ in range(int(input())):
	(l, m) = map(int, input().split())
	if m - l >= 2:
		c += 1
print(c)


class dorm:

	def __init__(self, a, b, c):
		self.x = a
		self.y = b
		self.z = c
n = int(input())
myList = []
for i in range(n):
	(p, q) = map(int, input().split())
	r = -1
	if q - p >= 2:
		r = 1
	room = dorm(p, q, r)
	myList.append(room)
avail = 0
for i in range(n):
	if myList[i].z == 1:
		avail += 1
print(avail)


can = 0
for x in range(int(input())):
	(r, rr) = input().split()
	(r, rr) = (int(r), int(rr))
	if rr - r >= 2:
		can += 1
print(can)


a = int(input())
i = 0
c = 0
while i < a:
	b = input().split(' ')
	g = int(b[0]) + 2
	x = int(b[1])
	if g <= x:
		c = c + 1
	i = i + 1
print(c)


a = int(input())
b = [0] * a
counter = 0
for i in range(a):
	b[i] = input().split()
	b[i][0] = int(b[i][0])
	b[i][1] = int(b[i][1])
	if b[i][1] - b[i][0] >= 2:
		counter = counter + 1
t = 0
print(counter)


t = int(input())
count = 0
for i in range(t):
	arr = list(map(int, input().split()))
	if arr[1] - arr[0] > 1:
		count += 1
print(count)


r = 0
for i in range(int(input())):
	d = list(map(lambda x: int(x), input().split()))
	r += 1 if d[1] - d[0] >= 2 else 0
print(r)


a = int(input())
x = int(0)
k = int(0)
while x < a:
	b = list(map(int, input().split()))
	if b[1] - b[0] >= 2:
		k = k + 1
	x = x + 1
print(k)


x = int(input())
step = 0
for i in range(x):
	(j, k) = input().split(' ')
	if int(k) - int(j) > 1:
		step += 1
print(step)


num = int(input())
c = 0
for i in range(num):
	(p, q) = map(int, input().split())
	if q > p + 1:
		c = c + 1
print(c)


from sys import stdin
rooms = int(input())
lis = 0
if rooms >= 1 and rooms <= 100:
	i = 0
	while i < rooms:
		arr = str(stdin.readline()).replace('\n', '').split(' ')
		if int(arr[0]) <= int(arr[1]) - 2:
			lis += 1
		i += 1
print(lis)


i = int(input())
m = 0
for j in range(i):
	(p, q) = map(int, input().split(' '))
	m += q - p >= 2
print(str(m))


n = int(input())
lst = []
for i in range(n):
	(a, b) = map(int, input().split())
	c = b - a
	lst.append(c)
c = 0
for i in range(len(lst)):
	if lst[i] >= 2:
		c += 1
print(c)


n = int(input())
rooms = 0
(people, capacity) = ([], [])
for i in range(n):
	s = input().split(' ')
	people.append(int(s[0]))
	capacity.append(int(s[1]))
for i in range(n):
	if capacity[i] - people[i] >= 2:
		rooms += 1
print(rooms)


import sys
import math
import bisect

def main():
	ans = 0
	for _ in range(int(input())):
		(a, b) = map(int, input().split())
		if b - a >= 2:
			ans += 1
	print(ans)
main()


class accom:

	def __init__(self, p, q):
		self.p = p
		self.q = q

	def ava(self):
		return self.q - self.p
arr = []
n = int(input())
for i in range(n):
	(p, q) = map(int, input().split())
	temp = accom(p, q)
	arr.append(temp)
r = 0
for j in arr:
	if j.ava() >= 2:
		r += 1
print(r)


from sys import stdin
N = int(stdin.readline())
total = 0
for room in range(N):
	(p, q) = map(int, stdin.readline().split())
	if q - p >= 2:
		total += 1
print(total)