from bisect import bisect_left, bisect_right
N = 1 << 17
INF = int(1e9) + 47
Tmin = [INF for i in range(4 * N)]
Tmax = [0 for i in range(4 * N)]
def mn(l, r, id = 1, tl = 0, tr = N - 1):
if (l == tl and r == tr):
return Tmin[id]
m = (tl + tr) // 2
if r <= m:
return mn(l, r, id * 2, tl, m)
elif l > m:
return mn(l, r, id * 2 + 1, m + 1, tr)
else:
return min(mn(l, m, id * 2, tl, m), mn(m + 1, r, id * 2 + 1, m + 1, tr))
def mx(l, r, id = 1, tl = 0, tr = N - 1):
if (l == tl and r == tr):
return Tmax[id]
m = (tl + tr) // 2
if r <= m:
return mx(l, r, id * 2, tl, m)
elif l > m:
return mx(l, r, id * 2 + 1, m + 1, tr)
else:
return max(mx(l, m, id * 2, tl, m), mx(m + 1, r, id * 2 + 1, m + 1, tr))
def setMin(i, d, id = 1, tl = 0, tr = N - 1):
if tl == tr:
Tmin[id] = d
return
m = (tl + tr) // 2
if i <= m:
setMin(i, d, id * 2, tl, m)
elif i > m:
setMin(i, d, id * 2 + 1, m + 1, tr)
Tmin[id] = min(Tmin[id * 2], Tmin[id * 2 + 1])
def setMax(i, d, id = 1, tl = 0, tr = N - 1):
if tl == tr:
Tmax[id] = d
return
m = (tl + tr) // 2
if i <= m:
setMax(i, d, id * 2, tl, m)
elif i > m:
setMax(i, d, id * 2 + 1, m + 1, tr)
Tmax[id] = max(Tmax[id * 2], Tmax[id * 2 + 1])
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
v = sorted(zip(a, b))
L = [0 for i in range(n)]
R = [n - 1 for i in range(n)]
setMin(0, 0)
for i in range(1, n):
j = bisect_left(v, (v[i][0] - v[i][1], -1))
L[i] = min(i, mn(j, i))
setMin(i, L[i])
setMax(n - 1, n - 1)
for i in range(n - 2, -1, -1):
j = bisect_right(v, (v[i][0] + v[i][1], INF))
R[i] = max(i, mx(i, j - 1))
setMax(i, R[i])
ans = 1
for i in range(n):
ans = max(ans, R[i] - L[i] + 1)
print(ans)