peterverebics/CodeNet_Python_118 huggingface dataset:
# cook your dish here
n=int(input())
a=list(map(int,input().split()))
st=[]
ans=0
for i in range(n):
    if i==0:
        st.append(a[i])
    else:
        if st[-1]>=a[i]:
            ans+=1
        else:
            st.append(a[i])
print(ans)
n=int(input())
num=list(map(int,input().split()))
don=[]
cnt=0
for i in num:
    flg=True
    for j in don:
        if i > j:
            flg=False
    if flg:
        cnt+=1
print(cnt)
N = input("")
L = input("").split(" ")
suc = N

def fun(num,s):
    suc = int(s)
    for j in range(num):
        if (L[j] < L[num]):
            suc -= 1
            break
    
    return suc
        

for i in range(int(N)):
    suc = fun(i,suc)
    
print(int(suc))
N = int(input())
P = list(map(int,input().split()))

count = 1
a = P[0]

for i in range(N-1):
  b = min(a,P[i])
  if b >= P[i+1]:
    
    count += 1
print(count)
n=input()
p=input()
p=p.split()
q=[]
for i in range(int(n)):
    if min(p[:i+1])==p[i]:
        q.append(p[i])
print(len(q))
import sys
import math
import itertools
N=int(input())
P=list(map(int,input().split()))
mn=10^6
cnt=0
for i in range(N):
    if P[i]<mn:
        mn=P[i]
    if P[i]<=mn:
        cnt+=1
print(cnt)
# C - Low Elements
n = (int)(input())

array = list(map(int, input().split()))

count = 0
flg = True
for i in range(0, n):
    for j in range(0, n):
        if j <= i and array[i] <= array[j]:
            continue
        else:
            flg = False
            break
    if flg:
        count += 1
    flg = True

print(sum)
n = int(input())
p = list(map(int, input().split( )))
c =0
m = p[0]
for i in range(n):
    if m - p[i] > 0:
        c += 1
    else:
        m = p[i]
print(c)
N = int(input())
List = [int(x) for x in input().split()]

cnt = 0
min_num = List[0]
for i in List[1:]:
    if i < min_num:
        min_num = i
        cnt += 1
print(cnt)
n = int(input())
numbers = list(map(int, input().split()))
count = 1
past = 0
for i in numbers:
    if past > i:
        count += 1
        past = i
print(count)
N = int(input())
p_list  = list(map(int,input().strip().split(" ")))

c = 1
if p_list == [p_list[0]]*N:
    print(len(p_list))

elif p_list == sorted(p_list):
    print(1)

elif p_list == sorted(p_list, reverse=True):
    print(len(p_list))

else:
    for i in range(1, N):
        p_list_min = min(p_list[:i])
        if p_list[i] <= p_list_min:
            c += 1
        

print(c)
n=int(input())
p=[int(i) for i in input().split()]
minmax=100000
ans=0
for i in range(n):
    if minmax>=p[i]:
        ans+=1
        minmax=min(minmax,p[i])
print(ans)
N=int(input())
P_list=list(map(int, input().split()))
print(P_list)
count=0
while P_list!=[]:
    minindex=P_list.index(min(P_list))
    P_list=P_list[0:minindex]
    count+=1
    
print(count)
N=int(input())
P=list(map(int,input().split()))
s=1
for i in range(1,N):
  count=0
  for j in range(0,i-1):
     if P[j]>P[i]:
        count+=1
  if count==i-1:
       s+=1
print(s)
n=int(input())
p=list(map(int,input().split()))
q=p
q.sort(reverse=True)

ans=0
for i in range(1,n+1):
  if q[i-1] in p:
    ans+=1
    del p[p.index(q[i-1]):]
    if len(p)==0:
      print(ans)
      exit()
N = int(input())
P= list(map(int,input().split()))

count = 1

for i in range(N-1):
 if P[i]>=P[i+1]:
  count += 1

print(count)
N = int(input())
P = list(map(int, input().split()))

m = 0
ans = 0
dp = [0 for _ in range(N+1)]
for i in range(N):
    if dp[i] <= P[i]:
        dp[i+1] = P[i]
        m = 1
    else:
        dp[i+1] = dp[i]
        m += 1
    ans = max(m, ans)

print(ans)
n = int(input())
p_li = list(map(int,input().split()))
min_v = p_li[0]
ans=1
for x in p_li:
    if x == 1:
        break
    if min_v>=x:
        min_v=x
    else:
        ans+=1
print(ans)
n = int(input())
ps = list(map(int, input().strip().split()))

cum_min = [0] * n

min_p = 1e9
for i in range(n):
    cum_min[i] = min(min_p, ps[i])

count = 0
for i in range(n):
    if i == 0:
        count += 1
    else:
        if cum_min[i - 1] >= ps[i]:
            count += 1

print(count)
n = int(input())
p = list(map(int, input().split()))

p_f = p[0]
c = 0

for i in p:
    if p_f >= 1:
        c +=1
        p_f = i

print(c)
N = int(input())
P = input().split()
c = []
l = 0
cont = False
for i in P:
  c.append(i)
  if min(c) == i:
    l = l + 1
print(l)
n=int(input())
lst = [ int(ele)for ele in input().split()]
lst = [n]+lst
t=0
for i in range(1,len(lst)):
    if lst[i]<=lst[i-1]:t+=1
print(t)
n=int(input())
p=[int(i) for i in input().split()]
cp=[min(p[i-1],p[i]) for i in range(1,n)]
c=0
for i in range(1,n):
  if cp[i-1]>=p[i]:
    c+=1
print(c+1)
n = int(input())
a = list(map(int,input().split()))

sum = 1

for kk in range(n-1):
    if a[kk] >= a[kk + 1]:
        sum += 1

print(sum)
n = int(input())
m = input().split()
ppp = list(map(int, m))
max = 2*10**5
ans = 0
for p in ppp:
    if p < max:
        ans += 1
        max = p
print(ans)
N = int(input())
p = list(map(int,input().split()))

cnt = 0
mi = 2*10**5
for i in range(N):
    a = p[i]
    if  mi > a:
        cnt += 1
        mi = a 
print(cnt)
import sys
import math
import itertools
N=int(input())
P=list(map(int,input().split()))
mn=10^6
cnt=0
for i in range(N):
    if P[i]<mn:
        mn=P[i]
        cnt+=1
print(cnt)
import numpy as np

N = int(input())
P_list = np.array([int(i) for i in input().split()])

# N = 5
# P_list = np.array([4, 2, 5, 1, 3])

# N = 1
# P_list = np.array([1])
# N = 8
# P_list = np.array([7 ,4 ,2 ,6 ,8 ,1 ,3])

count = 0

for i, p in enumerate(P_list, start=1):
    if np.sum(P_list[:i] >= p) != 0:
        count += 1

print(count)
n = int(input())
p = list(map(int, input().split()))
res = 1
for i in range(1,n):
    if p[i-1] > p[i]:
        res += 1
print(res)
N = int(input())
P = list(map(int,input().split()))
curmin = float('inf')
ans = 0
for p in P:
    if p <= curmin:
        ans += 1
    curmin = p
print(ans)
N = int(input())
P = list(map(int, input().split()))

mini = 10 ** 9
count = 1
for i in range(1, N):
    if P[i] <= mini:
        mini = P[i]
        count += 1
print(count)
N = int(input())
P = list(map(int, input().split()))

ans = 1
for i in range(1, N):
  if max(P[0:i]) >= P[i]:
    ans += 1

print(ans)
#!/usr/bin/env python3

def main():
    N = int(input())
    *P, = map(int, input().split())

    mini = 10**6
    cnt = 0
    for _ in P:
        if _ >= mini:
            mini = _
            cnt += 1
        else:
            continue
    print(cnt)


main()
n=int(input())
arr = list(map(int,input().split()))
c=ct=0
for i in range(n):
  c=0
  for j in range(i):
    if arr[j]<arr[i]:
      c+=1
  if c!=0:
    ct+=1
print(ct+1)
N = int(input())
P = list(map(int,input().split()))
count = 1
 
if N > 0:
  min = P[0]
  
for i in range(1, N):
  isbreak = False
  if i > 1:
    if P[i] < min :
      min = P[i]
      continue
    
  for j in range(0,i):
    if (P[i] > P[j]):
      isbreak = True
      break
  if isbreak == False:
    count += 1
    
print(count)
N=int(input())
m=input()
P=[]
for i in range(N):
  P.append(int(m.split()[i]))
count=0
for i in range(N-1):
  if(P[i]>P[i+1]):
    count+=1
  
print(count+1)
n=int(input())
A=list(map(int,input().split()))
ans=1
qq=A[0]
for i in range(n-1):
  if qq<A[i+1]:
    qq=A[i+1]
    continue
  else:
    ans+=1
print(ans)
N=int(input())
P=input().split()
count=0
for i in range(N):
  for j in range(i):
    if P[i]>P[j]:
      count=count+1
      #print(i,P[i],P[j])
      break
  
print(N-count)
N = int(input())
P = list(map(int, input().split()))

ans = 0
tmp = 0
for i in P:
  if i > tmp:
    ans += 1
  tmp = i
print(N - ans + 1)
n = int(input())
s = input()
c = 0
ar = s.split(' ')
for i in range(0, n):
  t = 0
  for j in range(0, i):
    if int(ar[i]) >= int(ar[j]):
    	t += 1
  if t > 0:
    c += 1
print(c)
def Convert(string): 
    li = list(string.split(" ")) 
    return li 

N = input().split()
L = Convert(input())
Min = L[0]
Sum = 0

for i in L:
    if i <= Min:
        Sum += 1
        Min = i

print(Sum)
n=int(input())
P=list(map(int,input().split()))
x=20001
ans = 0
for i in range(n):
  if x > P[i]:
    ans += 1
    x = P[i]
print(ans)
n = int(input())
List = list(map(int, input().split()))
count = 1

for i in range(n-1):
  if List[i] > List[i+1]:
    count += 1
print(count)
N = int(input())
P = list(map(int,input().split()))
n_min = 2 * 10 ^ 5 + 1
cnt = 0
for i in range(N):
    if P[i] < n_min:
        cnt += 1
        n_min = P[i]

print (cnt)
def solve(n, P):
  max_val = 1
  count = 0
  for p in P:
    if max_val >= p:
      count += 1
    if max_val < p:
      max_val = p
  return count

_n = int(input())
_P = list(map(int, input().split()))
print(_n, _P)
N=int(input())
A=list(map(int,input().split()))
count=1
c=min(A)
for i in range(1,len(A)):
    if max(A[0],A[i-1])<A[i]:
        pass
    else:
        count+=1
    if A[i]==c:
        break
print(count)
N = int(input())
P = list(map(int,input().split()))
ans = N

for i in range(N-1):
  if P[i]<P[i+1]:ans -= 1
  
print(ans)
n=int(input())
arr = list(map(int,input().split()))
c=ct=0
for i in range(n):
  c=0
  for j in range(i):
    if arr[i]<=arr[j]:
      c+=1
  if c!=0:
    ct+=1
print(ct+1)
n = int(input())
array = input().split()
count,m = 1,array[0]
for k in range(1,n):
  if array[k] < m:
    m = array[k]
    count = count + 1
print(count)
n=input()
lst = input().split()
lst = [n]+lst
t=0
for i in range(1,len(lst)):
    if lst[i]<=lst[i-1]:t+=1
print(t)
n=int(input())
a=list(map(int, input().split()))
a=a[::-1]
def LIS(L):
    from bisect import bisect
    seq=[]
    for i in L:
        pos=bisect(seq,i)
        if len(seq)<=pos:
            seq.append(i)
        else:
            seq[pos]=i
    return len(seq)
print(LIS(a))
N=int(input())
List=list(map(int,input().split()))
num=0

for i in range(N-1):
  if List[i]<List[i+1]:
    num = num + 1
  else:
    break

print(num+1)
N = int(input())
a = list(map(int,input().split()))



for i in range(0,N):
    count = 0
    for j in range(0,i):
        if a[i] <= a[j]:
            count+=1
    if count == i and count>=2:
        print(i)
        break
N=int(input())
p=list(map(int,input().split()))
m=1

for i in range(1,N):
    if p[i]<=p[i-1]:
        m+=1
print(m)
N = int(input())
P = list(map(int, input().split(' ')))

min = 10 ** 5
num = 1
for i in range(1, N):
  if P[i] <= min:
    num += 1
  if min > P[i - 1]:
    min = P[i - 1]
    
print(num)
N = int(input())
P = list(map(int, input().split()))
count = 1
for i in range(N-1):
    if P[i] == 1:
        break 
    if P[i] > P[i+1]:
        count += 1

print(count)
N = int(input())
P = list(map(int,input().split()))
ans = 1
k = [0]
#ans = 1は最低保障
for i in range(N):
  #P_i <= P_jの判定
  #P[i]-P[i+1] < 0なら　+1 
  k.append(P[i])
  if k[i+1]-k[i] < 0:
    ans += 1
print(ans)
N=int(input())
P = list(map(int,input().split()))
ans=0
m=10*10
 
for i in range(N):
    if m>=P[i]:
        ans+=1
        m=P[i]
print(ans)
N = int(input())
p = list(map(int , input().split()))

ret = 1
c_min = 2e5

for i in range(1, len(p)):
    if c_min > p[i]:
        c_min = p[i]
        ret+=1
print(ret)
import sys

n = int(input())
plist=[int(_) for _ in input().split()]

if n == 1:
  print("1")
  sys.exit()

result = 1
temp = 2*100000
for i in range(1,len(plist)):
  temp = min(plist[i],temp)
  if plist[i] <= temp:
    result += 1

print(result)
N=int(input())
p=list(map(int,input().split()))

Q=0
min_p=1000
for i in range(N):
    if min(p[i],min_p)>=p[i]:
        Q+=1
        min_p=min(p[i],min_p)
print(Q)
n = int(input())
li = [1] + list(map(int,input().split()))
cnt=0

for i in range(len(li)-1):
    if li[i] <= li[i+1]:
        cnt+=1
print(cnt)
N=int(input())
P=list(map(int,input().split()))

P.reverse()
ans=0
MAX=P[0]
for i in range(N):
    if P[i]>=MAX:
        ans=ans+1
        MAX=P[i]
print(ans)
N = int(input())
p = [int(e) for e in input().split(" ")]
low = p[0]
c = 0
for i in range(N):
    print(p[i], low)
    if(p[i] <= low):
        c += 1
        low = p[i]
print(c)
n=int(input())
lists=list(map(int,input().split()))
 
mn=(2*10)^5+1
cnt=0
for li in lists:
  if mn>=li:
    mn=li
    cnt+=1
print(cnt)
N=int(input())
P = list(map(int,input().split()))
ans=0
m=10*10
 
for i in P:
    if m>=i:
        ans+=1
        m=i
print(ans)
n = int(input())

p = list(map(int, input().split()))

count = 0

for i in range(n):
  correct = True
  print(i)
  for j in range(i+1):
    
    if p[i] > p[j]:
      correct = False
      break;
  
  if correct:
    count += 1
    
print(count)
N = int(input())
ls = list(map(int,input().split()))
ii = 0
for i in range(N-1):
    if ls[i] <= max(ls[i+1:N+1]):
        ii += 1

print(ii)
N = int(input())
P = list(map(int, input().split()))

ans = 0
min = P[0]
for i in P:
  if min > i:
    min = i
  elif i > min:
    ans += 1
print(ans)
n=int(input())
p=list(map(int,input().split()))
ans=1
m=p[0]
for i in range(1,n):
    if p[i]==1:
        ans=ans+1
    elif p[i]>m:
        continue
    else:
        ans=ans+1
        m=p[i]
print(ans)
n = int(input())
p = list(map(int, input().split( )))
c = 1
m = p[0]
for i in range(n - 1):
    if m - p[i + 1] > 0:
        c += 1
    else:
        m = p[i + 1]
print(c)
n = int(input())
a = list(map(int, input().split()))

dp = [0] * n

for i in range(n):
    dp[i] = 1
    for j in range(0, i):
            if a[j] >= a[i]:
                dp[i] = max(dp[i], dp[j] + 1)

print(max(dp))
n = int(input())
p = list(map(int,input().split()))

ans = int(1)
ANS = int(0)

for i in range(1,n):
  for j in range(0,i):
    if p[i] <=p[j]:
      ANS += 1
      if ANS == i:
        ans += 1
        ANS = 0
        continue
    else:
      break

print(ans)
n = int(input())
p = input().split()
now_min = p[0]
ans = 0
for i in range(n):
  if p[i] <= now_min:
    now_min = p[i]
    ans +=1
print(ans)
N = int(input())
P = [int(i) for i in input().split()]
INF = N+1

ans = 0
max_num = INF
for i in P:
    if i<=max_num:
        ans += 1
    max_num = i
print(ans)
n = int(input())
p = list(map(int, input().split()))
ans = 1
for i in range(1, n):
    if p[i] <= p[i-1]:
        ans += 1
print(ans)
N = int(input())
x = list(map(int,input().split()))
count = 0
for i in range(N):
  for j in range(i+1,N):
    if x[i] <= x[j]:
      count = count + 1 
      break
print(count)
N = int(input())
P = [int(i) for i in input().split()]
num = 1
if(N>1):
    for i in range (1,N):
      if P[i] <= P[i-1]:
        num +=1
print(num)
n = input()
arr = list(map(int, input().split()))
c= 1
for i in range(1,len(arr)):
  if arr[i-1] >= arr[i]:
    c +=1
print(c)
N=int(input())
P = list(map(int, input().split()))

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

cnt = 0
min = 10000
for i in range(n):
    if num_list[i] <= min:
        min = num_list[i]
        cnt += 1

print(cnt)
num = int(input())
p = map(int, input().split())
pList = list(p)
ret = 0

for i in range(num-1):
    check = True
    for j in range(i):
        if pList[i] >= pList[j]:
            check = False
            break
    if check == True:
        ret = ret + 1

print("{}".format(ret))
n,*p=map(int,open(0).read().split())
if p[0]>n:
    c=0
else:
    c=1
for i in range(1,n):
    if p[i]<=p[i-1]:
        c+=1
print(c)
N = int(input())
P = input().split(" ")

t = 1
list = []
for i in range(N):
    list.append(int(P[i]))
    if i == 0:
        m = P[i]
    elif int(P[i]) < int(P[i - 1]):
        m = int(P[i])
        
    if m == int(P[i]):
        t = t + 1

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

result = 0
for i in range(n):
    a = numbers[i]
    print(a)
    cnt =0
    for j in range(i):
        b = numbers[j]
        print(a,b)
        if b > a:
            cnt += 1
        else:
            break
    if i  == cnt:
        result += 1

print(result)
N = int(input())
A = list(map(int,input().split()))
maxNum = A[0]
cnt = 0
for i in range(N):
  if maxNum >= A[i]:
    cnt+=1
print(cnt)
N=int(input())
data = list(map(int, input().split()))
ans=0
min=data[0]
for i in range(0,N):
    minmin=data[0]
    if data[i]<=data[i-1]:
        minmin=data[i]
    if minmin<=data[i]:
        ans+=1

print(ans)
N=int(input())
P = list(input().split())

count=0
if(N==1):
  print(1)
else:
  for i in range(N):
    flg=True
    for j in range(i+1):
      if(P[i]>P[j]):
        flg=False
    if(flg==True):
      count+=1
  print(count)
n=int(input())
robot=[]
for i in range(n):
	x,l=map(int,input().split())
	robot.append([x,l])
robot.sort()
ans=1
for i in range(n-1):
	if robot[i][0]+robot[i][1]>robot[i+1][0]-robot[i+1][1]:
		if robot[i][0]+robot[i][1]<robot[i+1][0]+robot[i+1][1]:
			robot[i+1]=robot[i]
	else:
		ans+=1
print(ans)
N = int(input())

robots = []

# ロボットを設定する
for _ in range(N):
    x, l = map(int, input().split())
    robots.append([x-l, x+l])
    
# 手の届く最大値でソートする
robots = sorted(robots, key=lambda x: x[1])

# Maxが小さいもの優先で選択する
pos = robots[0][1]
cnt = 1
for i in range(1, len(robots)):
    robo = robots[i]
    if robo[0] >= pos:
        pos = robo[1]
        cnt += 1

print(cnt)
import sys
def I(): return int(sys.stdin.readline())
def LI(): return [int(x) for x in sys.stdin.readline().split()]

def main():
    N = I()
    ARM = []
    for i in range(N):
        X,L = LI()
        ARM.append([X-L,X+L])
    ARM.sort(key=lambda x: x[0])
    ARM.sort(key=lambda x: x[1])

    cur = -1 * (10**10)
    ans = 0

    for i in range(N):
        if cur <= ARM[i][0]:
            ans += 1
            cur = ARM[i][1]

    print(ans)

if __name__ == "__main__":
    main()
n=int(input())
a=[list(map(int,input().split())) for _ in range(n)]
b=[[a[i][0]+a[i][1],a[i][0]-a[i][1]] for i in range(n)]
b.sort()
ans=1
tmp=b[0][0]
for i in range(n):
  if tmp<=b[i][1]:
    ans+=1
    tmp=b[i][0]
print(ans)
import sys

input = sys.stdin.readline
    
n = int(input())
arm_range = []
for i in range(n):
    x, l = map(int, input().split())
    arm_range.append([x-l, x+l])

arm_range.sort(key=lambda x: x[1])
high = -float('inf')
count = 0
for a in arm_range:
    if a[0] >= high:
        high = a[1]
        count += 1

print(count)
import sys
input = sys.stdin.readline
def main():
    N = int( input())
    X = []
    for _ in range(N):
        x, l = map( int, input().split())
        X.append((x+l-1, x-l+1))
    X.sort()
    ans = 1
    now = X[0][0]
    for i in range(1,N):
        b, a = X[i]
        if now +1< a:
            now = b
            ans += 1
    print(ans)
    
if __name__ == '__main__':
    main()
n=int(input())
xl=[]

for i in range(n):
    x,l=list(map(int,input().split()))
    xl.append([x-l,x+l,x])

xl.sort(key=lambda x: x[1])

armmax=-10**10
cnt=0
for left,right,x in xl:
    if armmax<=left:
        armmax=right
        cnt+=1

print(cnt)
n  = int(input())
ps = []

for _ in range(0, n):
  x, l = [int(y) for y in input().split()]
  ps.append((x + l, x - l))

ps.sort()

x = ps[0][0]
d = 0

for i in range(1, n):
  p = ps[i]
  
  if p[1] < x:
    d += 1
  else:
    x = p[0]

print(n - d)
rs = [(x - l, x + l) for x, l in (map(int, input().split()) for _ in range(int(input())))]
rs.sort(key=lambda x: x[1])
last = - 10 ** 9
ans = 0
for l, r in rs:
    if last <= l:
        ans += 1
        last = r
print(ans)
from operator import itemgetter

def solve():
    N = int(input())
    X = []
    for i in range(N):
        xx, ll = map(int, input().split())
        X.append((xx-ll, xx+ll))
    X.sort(key=itemgetter(1))
    count = 0
    cur = -float('inf')
    for i in range(N):
        c, d = X[i]
        if cur <= c:
            count += 1
            cur = d
    return count

print(solve())
n = int(input())

count = 0
X = []
for i in range(n):
    x,l = map(int, input().split())
    X.append((x+l,x-l))
X.sort()
coord = -float('inf')

for i in X:
    if i[1] >= coord:
        count += 1
        coord = i[0]
print(count)
N=int(input())

rllist=[]
for _ in range(N):
  X,L=map(int,input().split())
  rllist.append((X+L,X-L))
rllist.sort()
#print(rllist)

answer=0
max_r=-float("inf")
for r,l in rllist:
  #print(max_r,l)
  if max_r<=l:
    answer+=1
    max_r=r
  
print(answer)
import sys
from operator import itemgetter

n = int(input())
robots = []
for line in sys.stdin:
    X, L = map(int, line.split())
    l, r = X - L, X + L
    robots.append((l, r))
robots.sort(key=itemgetter(1))

curr = -(10 ** 10)
ans = 0
for l, r in robots:
    if curr > l:
        continue
    ans += 1
    curr = r
print(ans)
INF = 1 << 60

n = int(input())
x = [0 for i in range(n)]
l = [0 for i in range(n)]
for i in range(n):
    x[i], l[i] = map(int, input().split())

itv = [[x[i] - l[i], x[i] + l[i]] for i in range(n)]
itv.sort(key=lambda x:x[1])
# print("itv =", itv)

ans = 0
t = -INF
for i in range(n):
    if t <= itv[i][0]:
        ans += 1
        t = itv[i][1]
print(ans)
def main():
    import sys
    input = sys.stdin.readline

    N = int(input())
    XL = []
    for i in range(N):
        x, l = map(int, input().split())
        XL.append((x, l))
    XL.sort(key=lambda p: p[1] + p[0])

    ans = 0
    prev = -10**10
    for i in range(N):
        x, l = XL[i]
        if x - l >= prev:
            ans += 1
            prev = x + l
    print(ans)


if __name__ == '__main__':
    main()
N = int(input())
lr = []
for i in range(N):
    x,l = map(int,input().split())
    LR = [x-l,x+l]
    lr.append(LR)
lr.sort(key=lambda x:x[1])
ans = 1
rb = lr[0][1]
for i in range(1,N):
    if lr[i][0] >= rb:
        rb = lr[i][1]
        ans += 1
print(ans)
import sys
input = sys.stdin.readline

n = int(input())
ll = []
for i in range(n):
  x, l = map(int, input().split())
  ll.append([x-l, x+l])
ll.sort(key=lambda x:x[1])

ans = 0
tmp = -10**9

for s, t in ll:
  if s >= tmp:
    ans += 1
    tmp = t

print(ans)
n = int(input())
s = [list(map(int, input().split())) for i in range(n)]

kukan=[[s[i][0]-s[i][1], s[i][0]+s[i][1]] for i in range(n)]
kukan.sort(key=lambda x:x[1])

count=1
mae=kukan[0][1]
for i in range(1,n):
    if kukan[i][0]>=mae:
        count+=1
        mae=kukan[i][1]

print(count)
n = int(input())
xl = [list(map(int, input().split())) for _ in range(n)]
A = sorted([(x+l, x-l) for x, l in xl])
now = A[0][0]
cnt = 1
for i, j in A:
  if now <= j:
    cnt += 1
    now = i
print(cnt)
N=int(input())
L=[list(map(int,input().split())) for i in range(N)]
R=[]
for i in range(N):
  a=max(0,L[i][0]-L[i][1])
  b=L[i][0]+L[i][1]
  R.append([b,a])
R.sort()

ans=0
last=0
for i in range(N):
  if last<=R[i][1]:
    ans+=1
    last=R[i][0]
print(ans)
def solve(XL, N):
    XL.sort(key=lambda x:x[1])
    count = N
    for i in range(1, N):
        if XL[i][0] < XL[i-1][1]:
            XL[i][1] = XL[i-1][1]
            count -= 1
    return count
N = int(input())
XL = []
for i in range(N):
    x, l = map(int, input().split(' '))
    XL.append([x-l, x+l])
print(solve(XL, N))
n = int(input())
XL = []
for _ in range(n):
    x, l = map(int, input().split())
    x_min = x - l
    x_max = x + l
    XL.append((x,l, x_min, x_max))

XL = sorted(XL, key=lambda x: x[3])

now = 0
count = 0
for i in range(1,n):
    if XL[now][3] > XL[i][2]:
        count += 1
    else:
        now = i
ans = n - count

print(int(ans))
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
 
n = int(readline())
m = map(int,read().split())
xl = zip(m,m)
c = [(x-l,x+l) for x,l in xl]
  
from operator import itemgetter
c.sort()
c.sort(key=itemgetter(1))

ans = 1
chk = c[0][1]
for i,j in c:
  if i >= chk:
    ans +=1
    chk = j
    
print(ans)
N = int(input())
X = []
for i in range(N):
    x,l=map(int,input().split())
    X.append([x-l,x+l])

X = sorted(X, key=lambda x:x[1])
a = X[0][0]-1
ans = 0
for i in range(N):
    if X[i][0] >= a:
        a =X[i][1]
        ans +=1
    else:
        continue
print(ans)
from sys import stdin
N = int(stdin.readline().rstrip())

XL = []
for i in range(N):
    x, l = [int(_) for _ in stdin.readline().rstrip().split()]
    XL.append([x-l, x+l])
XL = sorted(XL, key=lambda x: x[1])

ans = 0
tmp = -10**9
for i in range(N):
    if XL[i][0] >= tmp:
        tmp = XL[i][1]
        ans += 1
print(ans)