Harryxun/stf_run huggingface dataset:
n = int(input())
a = sorted([list(map(int, input().split())) for _ in range(n)])
d = {}
ret = float('inf')
for i in range(n - 1):
    for j in range(i + 1, n):
        p, q = a[j][0] - a[i][0], a[j][1] - a[i][1]
        if p == 0 and q == 0:
            continue
        key = (p, q)
        d.setdefault(key, 0)
        d[key] += 1
print(n - max(d.values()))


### FIXED CODE ###

n = int(input())
a = sorted([list(map(int, input().split())) for _ in range(n)])
d = {}
ret = float('inf')
for i in range(n - 1):
    for j in range(i + 1, n):
        p, q = a[j][0] - a[i][0], a[j][1] - a[i][1]
        if p == 0 and q == 0:
            continue
        key = (p, q)
        d.setdefault(key, 0)
        d[key] += 1
print(n - (max(d.values()) if d  else 0))
def main():
    a, b = map(int, input().split())
    if b / a % 0:
        print(a + b)
    else:
        print(b - a)


if __name__ == "__main__":
    main()


### FIXED CODE ###

def main():
    a, b = map(int, input().split())
    if b % a == 0:
        print(a + b)
    else:
        print(b - a)


if __name__ == "__main__":
    main()
X = input()
tmp = X // 500
ans = tmp * 1000 + X % 500 - ((X % 500) % 5)
print(ans)

### FIXED CODE ###

X = int(input())
tmp = X // 500
ans = tmp * 1000 + X % 500 - ((X % 500) % 5)
print(ans)
S=input()
N=len(S)

def kaibun_checker(s):
    rev_s = s[::-1]
    len_s = len(s)
    for i in range(len_s//2):
        if s[i]!=rev_s[i]:
            return False
    return True

if kaibun_checker(S[:]) and kaibun_checker(S[(N+3)//2]) and kaibun_checker(S[(N+3)//2-1:]):
    print('Yes')
else:
    print('No')

### FIXED CODE ###

S=input()
N=len(S)

def kaibun_checker(s):
    rev_s = s[::-1]
    len_s = len(s)
    for i in range(len_s//2):
        if s[i]!=rev_s[i]:
            return False
    return True

if N==3:
    print('Yes' if S[0]==S[2] else 'No')
else:
    if kaibun_checker(S[:]) and kaibun_checker(S[(N+3)//2]) and kaibun_checker(S[(N+3)//2-1:]):
        print('Yes')
    else:
        print('No')
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
wa = 0
prev = 0
for i in range(N):
    wa += B[A[i]-1]
    if(prev == A[i]-2):
        wa += C[i-2]
    prev = A[i]-1
print(wa)
        

### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
wa = 0
for i in range(N):
    wa += B[A[i]-1]
    if(i > 0 and A[i]-A[i-1] == 1):
        wa += C[A[i-1]-1]
print(wa)
# -*- coding: utf-8 -*-
"""
Created on Wed May  2 21:28:06 2018
ALDS1_5a
@author: maezawa
"""
import itertools as itr

n = int(input())
a = list(map(int, input().split()))
q = int(input())
m = list(map(int, input().split()))

sum_array = []
for r in range(1,n+1):
    for comb in itr.combinations(a, r):
        sum_array.append[sum(comb)]

for i in m:
    yesorno = 'no'
    for j in sum_array:
        if i == j:
            yesorno == 'yes'
            break
    print('yes')



### FIXED CODE ###

# -*- coding: utf-8 -*-
"""
Created on Wed May  2 21:28:06 2018
ALDS1_5a_r1  
@author: maezawa
"""
import itertools as itr

n = int(input())
a = list(map(int, input().split()))
q = int(input())
m = list(map(int, input().split()))

sum_array = []
for r in range(1,n+1):
    for comb in itr.combinations(a, r):
        sum_array.append(sum(comb))
sum_array.sort()

for i in m:
    left = 0
    right = len(sum_array)
    yesorno = 'no'
    while(left < right):
        #print(left, right)
        mid = (left+right)//2
        if sum_array[mid] == i:
            yesorno = 'yes'
            break
        elif sum_array[mid] > i:
            right = mid
        else:
            left = mid+1
            
    print(yesorno)
my_range = int(input())
data_in = list(map(int,input().split()))
n_of_odd = 0
for ind in range(int(my_range/2)+1):
  rem = data_in[2*ind] % 2
  n_of_odd = n_of_odd + rem
print(n_of_odd)

### FIXED CODE ###

my_range = int(input())
data_in = list(map(int,input().split()))
n_of_odd = 0
for ind in range(my_range):
  if (ind % 2) == 0:
    rem = data_in[ind] % 2
    n_of_odd = n_of_odd + rem
print(n_of_odd)
while(1):
  count = input()
  if count == 0: break
  original_cube = [1, 2, 3, 4, 5, 6]
  operation{'North':[2, 6, 3, 4, 1, 5], 'East':[4, 2, 1, 6, 5, 3], 'West': [3, 2, 6, 1, 5, 4], 'South':[5, 1, 3, 4, 6, 2], 'Right':[1, 3, 5, 2, 4, 6], 'Left[1, 4, 2, 5, 3, 6]}
  sum = 1
  for i in xrange(count):
    new_cube = []
    for e in operation[raw_input()]:
      new_cube.append(previous_cube[e])
    sum += new_cube[0]
    previous_cube = new_ccube
  print sum

### FIXED CODE ###

while 1:
  n = input()
  if n == 0:  break
  d = range(1, 7)
  ans = 1
  for i in range(n):
    c = raw_input()[0]
    if c == 'N': S = [1,5,2,3,0,4]
    elif c == "S": S = [4,0,2,3,5,1]
    elif c == "E": S = [3,1,0,5,4,2]
    elif c == "W": S = [2,1,5,0,4,3]
    elif c == "R": S = [0,2,4,1,3,5]
    elif c == "L": S = [0,3,1,4,2,5]
    d = [d[s] for s in S]
    ans += d[0]
  print ans
n, m = map(int, input().split())

ac = [0]*n
wa = [0]*n

for i in range(m):
  p, s = input().split()
  p = int(p)-1

  if s == 'WA' and ac[p] == 0:
    wa[p] += 1
  elif s == 'AC' and ac[p] == 0:
    ac[p] += 1

print('%d %d' % (sum(ac), sum(wa[k] for k in [i for i,j in enumerete(ac) if j != 0])))

### FIXED CODE ###

N, M = map(int, input().split())
 
ac, wa = [0]*N, [0]*N
 
for i in range(M):
    p, s = input().split()
    if s == 'WA' and ac[int(p)-1] == 0:
            wa[int(p)-1] += 1
    elif s == 'AC' and ac[int(p)-1] == 0:
            ac[int(p)-1] += 1
print('%d %d' % (sum(ac), sum([wa[k] for k in [i for i, j in enumerate(ac) if j != 0]])))
from collections import defaultdict
import heapq

with open("input.txt","r") as f:
    vertice,edge,source = map(int,input().split(" "))
    link = [[] for n in range(vertice)]
    weight = defaultdict(dict)
    for e in range(edge):
        i,j,w = map(int,input().split(" "))
        link[i].append(j)
        weight[i].update({j:w})
    #print(weight,link)
    for v in range(vertice):
        goal = v
        queue = []
        heapq.heappush(queue,[0,source])
        went = set()

        while queue != []:
            #print(queue)
            now_cost,here = heapq.heappop(queue)
            #print(now_cost,here,queue)
            if here == goal:
                print(now_cost)
                break

            can_go = link[here]
            not_went = set(can_go) - went
            #print(v,here,now_cost,not_went,queue)
            for nw in not_went:
                next_cost = now_cost + weight[here][nw]
                heapq.heappush(queue,(next_cost,nw))
            went = went | {here}
            queue.sort(key=lambda x:x[1],reverse=True)
        else:
            print("INF")

                

### FIXED CODE ###

import sys
from heapq import heappush, heappop
readline = sys.stdin.readline
from collections import defaultdict
vertices, edges, start = map(int, readline().split())
connect = defaultdict(list)
cost = defaultdict(dict)
answer = ["INF" for n in range(vertices)]
for _ in range(edges):
    s, t, w = map(int, readline().split())
    connect[s].append(t)
    cost[s].update({t:w})
 
 
now = start
weight = 0
p_queue = []
heappush(p_queue, (0, now))
visited = set()
while p_queue:
    weight, now = heappop(p_queue)
    if now in visited:
        continue
    visited |= {now}
    answer[now] = weight
    for c in connect[now]:
        if c not in visited:
            heappush(p_queue, (weight + cost[now][c], c))
for a in answer:
    print(a)
import numpy as np

N,K,L = map(int, input().split())

#print(N,K,L,D,T)

array_D = np.eye(N,N,dtype=int)
array_T = np.eye(N,N,dtype=int)
root_D = [i for i in range(N)]
root_T = [i for i in range(N)]

for _ in range(K):
    d0, d1 = map(int, input().split())
    d0 = d0 - 1
    d1 = d1 - 1
    r0 = root_D[d0]
    r1 = root_D[d1]
    array_D[r0] = array_D[r0] | array_D[r1]
    root_D[r1] = r0
    root_D[d1] = r0
    #print(list_D, root_D)

for _ in range(L):
    t0, t1 = map(int, input().split())
    t0 = t0 - 1
    t1 = t1 - 1
    r0 = root_T[t0]
    r1 = root_T[t1]
    array_T[r0] = array_T[r0] | array_T[r1]
    root_T[r1] = r0
    root_T[t1] = r0
    #print(list_T, root_T)

#和集合
res = [0] * N
for i in range(N):
    rd = root_D[i]
    rt = root_T[i]
    d = array_D[rd]
    t = array_T[rt]
    res[i] = sum(d & t)
#print(*(res[i] for i in range(N)))
print(" ".join([str(i) for i in res]))

### FIXED CODE ###

import sys
 
sys.setrecursionlimit(10000)

N,K,L = map(int, input().split())

#print(N,K,L,D,T)

class UnionFind:
    def __init__(self, n):
        self.par = [i for i in range(n+1)]
        self.rank = [0] * (n+1)

    # 検索
    def find(self, x):
        if self.par[x] == x:
            return x
        else:
            self.par[x] = self.find(self.par[x])
            return self.par[x]

    # 併合
    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if self.rank[x] < self.rank[y]:
            self.par[x] = y
        else:
            self.par[y] = x
            if self.rank[x] == self.rank[y]:
                self.rank[x] += 1

    # 同じ集合に属するか判定
    def same_check(self, x, y):
        return self.find(x) == self.find(y)

def execOne(num, uf):
    for _ in range(num):
        d0, d1 = map(int, input().split())
        d0 = d0 - 1
        d1 = d1 - 1
        uf.union(d0, d1)

uf_D = UnionFind(N)
uf_T = UnionFind(N)

execOne(K, uf_D)
execOne(L, uf_T)


pairs = []
for i in range(N):
    pairs.append((uf_D.find(i), uf_T.find(i)))

pairs_count = {}
for p in pairs:
    if not p in pairs_count:
        pairs_count[p] = 1
    else:
        pairs_count[p] += 1

res = [0] * N
for i in range(N):
    res[i] = pairs_count[pairs[i]]
#print(*(res[i] for i in range(N)))
print(" ".join([str(i) for i in res]))
import numpy as np
n,k=map(int,input().split())
P=list(map(int,input().split()))
p=np.cumsum(P)
s=[0]*(n//k+1)
MAX=p[0]
ans=0
for i in range(0,n-k):
    MAX=max(MAX,p[i+k]-p[i])
    if MAX==p[i+k]-p[i]:
        s=i
for j in P[s+1:s+k+1]:
    ans+=(1+j)/2
print(ans)

### FIXED CODE ###

n,k=map(int,input().split())
p=[(i+1)/2 for i in map(float,input().split())]
MAX=sum(p[0:k])
s=[MAX]*n
for i in range(0,n-k):
    s[i+1]=p[i+k]+s[i]-p[i]
    MAX=max(MAX,s[i+1])
print(MAX)
import sys
input = sys.stdin.readline
import numpy as np

h, w = map(int, input().split())
A = np.array([input().split() for _ in range(h)], dtype=np.int64)
B = np.array([input().split() for _ in range(h)], dtype=np.int64)
D = abs(A-B)
M = 80*(h*w)
dp = np.zeros((h, w, 2*M), dtype=bool)
dp[0, 0, M-D[0, 0]] = True
dp[0, 0, M+D[0, 0]] = True
for i in range(h):
  for j in range(w):
    if i:
      dp[i, j, D[i, j]:] |= dp[i-1, j, :-D[i, j]]
      dp[i, j, :-D[i, j]] |= dp[i-1, j, D[i, j]:]
    if j:
      dp[i, j, D[i, j]:] |= dp[i, j-1, :-D[i, j]] 
      dp[i, j, :-D[i, j]] |= dp[i, j-1, D[i, j]:]
idx = np.where(dp[-1, -1, M:])[0][0]
print(idx)

### FIXED CODE ###

import sys
input = sys.stdin.readline

def main():
  h, w = map(int, input().split())
  A = [list(map(int, input().split())) for _ in range(h)]
  B = [list(map(int, input().split())) for _ in range(h)]
  M = 80*(h+w)
  dp = [[0]*w for i in range(h)]
  d = abs(A[0][0] - B[0][0])
  mask = (1 << (2*M)) - 1
  dp[0][0] |= 1 << (M-d)
  dp[0][0] |= 1 << (M+d)
  for i in range(h):
    for j in range(w):
      d = abs(A[i][j] - B[i][j])
      if i:
        dp[i][j] |= (dp[i-1][j] << d) & mask
        dp[i][j] |= dp[i-1][j] >> d
      if j:
        dp[i][j] |= (dp[i][j-1] << d) & mask
        dp[i][j] |= dp[i][j-1] >> d
  t = dp[-1][-1] >> M
  ans = (t & (-t)).bit_length() - 1
  print(ans)
  
if __name__ == "__main__":
  main()
n, k = map(int, input().split())
a = list(map(int, input().split()))
MOD = 10 ** 9 + 7

plus = []
minus = []
zero = []
for i in range(n):
    if a[i] < 0:
        minus.append(abs(a[i]))
    elif a[i] > 0:
        plus.append(a[i])
    else:
        zero.append(0)


len_p = len(plus)
len_m = len(minus)
len_z = len(zero)

is_z = False
is_p = False
if len_z != 0:
    is_z = True

cnt = len_m // 2 + len_p
if cnt >= k:
    is_p = True

if is_p:
    minus = sorted(minus, reverse=True)
    plus = sorted(plus, reverse=True)
    ans = 1
    if k % 2 == 1:
        k -= 1
        ans = plus[0]
        del plus[0]
    tmp = []
    for i in range(len(minus) // 2):
        tmp.append(minus[2 * i] * minus[2 * i + 1] % MOD)
    for i in range(len(plus) // 2):
        tmp.append(plus[2 * i] * plus[2 * i + 1] % MOD)
    tmp = sorted(tmp, reverse=True)
    for i in range(k // 2):
        ans *= tmp[i]
        ans %= MOD
    print(ans)
    exit()

elif is_z:
    print(0)
    exit()

else:
    minus = sorted(minus)
    ans = -1
    for i in range(k):
        ans *= minus[i]
        ans %= MOD
    print(ans)
    exit()


### FIXED CODE ###

n, k = map(int, input().split())
a = list(map(int, input().split()))
MOD = 10 ** 9 + 7

plus = []
minus = []
zero = []
for i in range(n):
    if a[i] < 0:
        minus.append(abs(a[i]))
    elif a[i] > 0:
        plus.append(a[i])
    else:
        zero.append(0)


len_p = len(plus)
len_m = len(minus)
len_z = len(zero)

is_z = False
is_p = False
if len_z != 0:
    is_z = True

cnt = 2 * (len_m // 2) + len_p
if cnt >= k:
    is_p = True
if len_p == 0 and k % 2 == 1:
    is_p = False

if is_p:
    minus = sorted(minus, reverse=True)
    plus = sorted(plus, reverse=True)
    ans = 1
    if k % 2 == 1:
        k -= 1
        ans = plus[0]
        del plus[0]
    tmp = []
    for i in range(len(minus) // 2):
        tmp.append(minus[2 * i] * minus[2 * i + 1])
    for i in range(len(plus) // 2):
        tmp.append(plus[2 * i] * plus[2 * i + 1])
    tmp = sorted(tmp, reverse=True)
    for i in range(k // 2):
        ans *= tmp[i]
        ans %= MOD
    print(ans)
    exit()

elif is_z:
    print(0)
    exit()

else:
    for i in plus:
        minus.append(i)
    minus = sorted(minus)
    ans = -1
    for i in range(k):
        ans *= minus[i]
        ans %= MOD
    print(ans)
    exit()
n, m=map(int, input().split())
a=[0 for i in range(m)]
b=[0 for i in range(m)]
g=[list() for i in range(1+n)]
#print(g)

par=[i for i in range(m)]
cnt_con=[1 for i in range(m)]

def root(x):
    if x==par[x]:
        return x
    else:
        par[x]=root(par[x])
        return par[x]
def connect(x,y):
    #par[x]=root(x)
    #par[y]=root(y)
    if root(x)==root(y):
        0
    else:
        cnt_con[root(y)]+=cnt_con[root(x)]
        par[root(x)]=root(y)      
    return

for i in range(m):
    a[i], b[i]=map(int, input().split())
    a[i], b[i]=a[i]-1, b[i]-1

tmp=int(n*(n-1)/2)
ans=[0]*m
ans[-1]=tmp
ans[0]=0
#print('a,b=',a,b)
for i in range(m-1,-1,-1):
    ans[i]=tmp
    if root(a[i])==root(b[i]):
        0
    else:
        tmp-=cnt_con[root(a[i])]*cnt_con[root(b[i])]
    connect(a[i],b[i])
    #print('i,tmp',i,(a[i],b[i]),ans[i],tmp,par,cnt_con)
    
        
    
for i in range(m):
    print(ans[i])

### FIXED CODE ###

import sys
sys.setrecursionlimit(100000)

n, m=map(int, input().split())
a=[0 for i in range(m)]
b=[0 for i in range(m)]
g=[list() for i in range(1+n)]
#print(g)

par=[i for i in range(n)]
cnt_con=[1 for i in range(n)]

def root(x):
    if x==par[x]:
        return x
    else:
        par[x]=root(par[x])
        return par[x]
def connect(x,y):
    #par[x]=root(x)
    #par[y]=root(y)
    if root(x)==root(y):
        0
    else:
        cnt_con[root(y)]+=cnt_con[root(x)]
        par[root(x)]=root(y)      
    return

for i in range(m):
    a[i], b[i]=map(int, input().split())
    a[i], b[i]=a[i]-1, b[i]-1


tmp=int(n*(n-1)/2)
ans=[0]*m
ans[-1]=tmp
#ans[0]=0
#print('a,b=',a,b)
for i in range(m-1,-1,-1):
    ans[i]=tmp
    if root(a[i])==root(b[i]):
        0
    else:
        tmp-=cnt_con[root(a[i])]*cnt_con[root(b[i])]
    connect(a[i],b[i])
    #print('i,tmp',i,(a[i],b[i]),ans[i],tmp,par,cnt_con)
    

    
for i in range(m):
    print(ans[i])
n = list(input())
for i in 3:
    if n[i] == "1":
        n[i] = "9"
    elif n[i] == "9":
        n[i] = "1"
print("".join(n))

### FIXED CODE ###

n = list(input())

for i in range(3):
    if n[i] == "1":
        n[i] = "9"
    elif n[i] == "9":
        n[i] = "1"

for j in range(3):
  print(n[j], end="")
N = int(input())
S =[[] for _ in range(N)]
for i in range(N):
  s = list(str(input()))
  s.sort()
  s = ''.join(s)
  S[i].append(s)
from collections import Counter
l = Counter(S)
count = []
for i in l.values:
  count.append(i*(i-1)/2)
print(sum(count))
  



### FIXED CODE ###

N = int(input())
S =[]
for i in range(N):
  s = list(str(input()))
  s.sort()
  s = ''.join(s)
  S.append(s)
from collections import Counter
l = Counter(S)
count = []
for i in l.values():
  count.append(i*(i-1)/2)
print(int(sum(count)))
s = input()
t = input()
if s==t:
    print('No')
    exit()
s = list(s)
t = list(t)
s_ = sorted(s)
t_ = sorted(t)
t_.reverse()
print(s_)
print(t_)
for i in range(len(s_)):
    if s[i]<t[i]:
        print('Yes')
        exit()
    elif s[i]>t[i]:
        print('No')
        exit()
print('Yes')

### FIXED CODE ###

s = input()
t = input()
s = list(s)
t = list(t)
s_ = sorted(s)
t_ = sorted(t)
t_.reverse()
if ''.join(s_)<''.join(t_):
    print('Yes')
else:
    print('No')
a, b = int(input())
if a + b >= 10:
  print('error')
else:
  print(a+b)

### FIXED CODE ###

a, b = map(int,input().split())
if a + b >= 10:
  print('error')
else:
  print(a+b)
s=input()
S=''
for i in range(len(s))
    S+='x'
print(S)

### FIXED CODE ###

s=input()
print('x'*len(s))
import collections

N = int(input())

c = collections.Counter(input())
for i in range(N-1):
    x = collections.Counter(input())
    ans=[]
    for j in c.keys():
        c[j] = min(c[j], x[j])
        ans.append(j*c[j])
        ans.sort()

print(*ans, sep="")

### FIXED CODE ###

import collections

N = int(input())

S = collections.Counter(list(input()))
for i in range(N-1):
    c = collections.Counter(list(input()))
    S &= c

ans = []
for i in S.items():
    ans += i[0]*i[1]
ans.sort()
print(*ans, sep="")
# coding: utf-8
# Your code here!
S=list(input())

nums=[1 if S[0]=="<" else -1]
for i in range(len(S)-1):
    if S[i+1]==S[i]:
        if S[i+1]=="<":
            nums[-1]+=1
        else:
            nums[-1]-=1
    else:
        if S[i+1]=="<":
            nums.append(1)
        else:
            nums.append(-1)

ans=0
if nums[0]<0:
    are=nums.pop(0)
    ans+=are*(are+1)//2
if nums[-1]>0:
    are=nums.pop(-1)
    ans+=are*(are+1)//2

temp=list(map(lambda x:abs(x)-1,nums))
temp=list(map(lambda x:x*(x+1)//2,temp))

ans+=sum(temp)
#print(ans)
for i in range(len(nums)-1):
    if nums[i]>0:
        ans+=max(nums[i],-nums[i+1])
#print(nums)
print(ans)


### FIXED CODE ###

# coding: utf-8
# Your code here!
S=list(input())

nums=[1 if S[0]=="<" else -1]
for i in range(len(S)-1):
    if S[i+1]==S[i]:
        if S[i+1]=="<":
            nums[-1]+=1
        else:
            nums[-1]-=1
    else:
        if S[i+1]=="<":
            nums.append(1)
        else:
            nums.append(-1)

ans=0
if nums[0]<0:
    are=-nums.pop(0)
    ans+=are*(are+1)//2
    if nums:
        pass
    else:
        print(ans)
        exit()
if nums[-1]>0:
    are=nums.pop(-1)
    ans+=are*(are+1)//2
    if nums:
        pass
    else:
        print(ans)
        exit()

temp=list(map(lambda x:abs(x)-1,nums))
temp=list(map(lambda x:x*(x+1)//2,temp))

#print(temp)
ans+=sum(temp)
#print(ans)
for i in range(len(nums)-1):
    if nums[i]>0:
        ans+=max(nums[i],-nums[i+1])

print(ans)
import math

N, X = map(int, input().split())

x = [X] + list(map(int, input().split()))
x.sort()

dic = []

for i in range(1, len(x)):
    tmp = x[i] - x[i - 1]
    if len(dic) == 0 or tmp not in dic:
        dic.append(tmp)

ans = max(dic)

for i in range(1, len(dic)):
    ans = min(ans, math.gcd(dic[i], dic[i - 1]))

print(ans)

### FIXED CODE ###

import fractions

N, X = map(int, input().split())

x = [X] + list(map(int, input().split()))
x.sort()

dic = []

for i in range(len(x) - 1):
    tmp = x[i + 1] - x[i]
    if tmp not in dic:
        dic.append(tmp)

ans = max(dic)

for i in range(len(dic) - 1):
    ans = min(ans, fractions.gcd(dic[i], dic[i + 1]))

print(ans)
int(input())
A = [list(map(int,input().split())) for i in list(range(N))]
B = [[i[0]+i[1], i[0]-i[1]] for i in A]
B.sort()
prev=B[0]
cnt=N
for i in range(1,N):
  if prev[0]<B[i][1]:
    cnt-=1
  else:
    prev=B[i]
print(cnt)  


### FIXED CODE ###

#!/usr/bin python3
# -*- coding: utf-8 -*-

def main():
    N = int(input())
    XL = [None] * N
    for n in range(N):
        X, L = map(int,input().split())
        XL[n] = [X-L,X+L]
    XL.sort(key=lambda x:x[1])
    ret = 1
    TMP = XL[0][1]
    for x in XL[1:]:
        if TMP<=x[0]:
            TMP = x[1]
            ret += 1
    print(ret)

if __name__ == '__main__':
    main()
from operator import itemgetter
n=int(input())
xl=[list(map(int,input().split()))for i in range(N)]
R=[list(xl[i][0]-xl[i][1],xl[i][0]+xl[i][1]) for i in range(n)]
r=sorted([(R[i][0],R[i][1]) for i in range(n)],key=itemgetter(1))
s=r[0][1]
ans=1
for i in range(n-1):
    if r[i+1][0]>=s:
        s=r[i+1][1]
        ans+=1
print(ans)

### FIXED CODE ###

from operator import itemgetter
n=int(input())
xl=[list(map(int,input().split()))for i in range(n)]
R=[(xl[i][0]-xl[i][1],xl[i][0]+xl[i][1]) for i in range(n)]
r=sorted([(R[i][0],R[i][1]) for i in range(n)],key=itemgetter(1))
s=r[0][1]
ans=1
for i in range(n-1):
    if r[i+1][0]>=s:
        s=r[i+1][1]
        ans+=1
print(ans)
def main():
    n, m, k = map(int, input().split())
    aa = list(map(int, input().split()))
    bb = list(map(int, input().split()))
    time_sum = 0
    for i in range(n):
        for j in range(1, m):
            time_sum = aa[:i] + bb[:j]
            if time_sum <= k:
                ans.append(i+j)

    if(len(ans) == 1):
        return ans[0]
    else:
        return max(ans)


if __name__ == '__main__':
    ans = main()
    print(ans)


### FIXED CODE ###

n, m, k = map(int, input().split())
aa = list(map(int, input().split()))
bb = list(map(int, input().split()))
asum = [0]
bsum = [0]

for i in range(len(aa)):
    asum.append(asum[i]+aa[i])
for i in range(len(bb)):
    bsum.append(bsum[i]+bb[i])

j = len(bsum)-1
ans = 0
for i in range(len(asum)):
    while j >= 0:
        if k >= asum[i] + bsum[j]:
            ans = max(ans, i+j)
            break
        else:
            j -= 1


print(ans)
n, k = map(int, input().split())
s = input()
m = min(s)
if k >= 20:
    print(m * n)
else:
    for p in range(k):
        u = s + s[::-1]
        l = []
        cnt = 0
        idx = 0
        for i in range(n * 2):
            if u[i] == m:
                if cnt == 0:
                    idx = i
                cnt += 1
            else:
                if cnt > 0:
                    l.append((cnt, idx))
                    cnt = 0
        a, j = max(l)
        for c, i in l:
            if i <= n and c == a:
                s = min(s, u[i:i + n])
        if (k - p) % 2 == 0:
            s = s[::-1]
    print(s)


### FIXED CODE ###

n, k = map(int, input().split())
s = input()
m = min(s)
for p in range(k):
    u = s + s[::-1]
    l = []
    cnt = 0
    idx = 0
    for i in range(n * 2):
        if u[i] == m:
            if cnt == 0:
                idx = i
            cnt += 1
        else:
            if cnt > 0:
                l.append((cnt, idx))
                cnt = 0
    if cnt > 0:
        l.append((cnt, idx))
    a, j = max(l)
    if a >= n:
        print(m * n)
        exit(0)
    for c, i in l:
        if i <= n and c == a:
            s = min(s, u[i:i + n])
    s = s[::-1]
print(s[::-1])
S = input()

if S == "SAT":
    print(1)
elif S=="FRI":
    print(2)
elif S=="THU":
    print(3)
elif S=="WED":
    print(4)
elif S=="TUE":
    print(5)
elif S=="MON":
    print(6)
else S=="SUN":
    print(7)
 


### FIXED CODE ###

S = input()

if S == "SUN":
    print(7)
elif S == "MON":
    print(6)
elif S == "TUE":
    print(5)
elif S == "WED":
    print(4)
elif S == "THU":
    print(3)
elif S == "FRI":
    print(2)
else:
    print(1)