After the mysterious disappearance of Ashish, his two favourite disciples Ishika and Hriday, were each left with one half of a secret message. These messages can each be represented by a permutation of size $n$. Let's call them $a$ and $b$.

Note that a permutation of $n$ elements is a sequence of numbers $a_1, a_2, \ldots, a_n$, in which every number from $1$ to $n$ appears exactly once. 

The message can be decoded by an arrangement of sequence $a$ and $b$, such that the number of matching pairs of elements between them is maximum. A pair of elements $a_i$ and $b_j$ is said to match if:   $i = j$, that is, they are at the same index.  $a_i = b_j$ 

His two disciples are allowed to perform the following operation any number of times:   choose a number $k$ and cyclically shift one of the permutations to the left or right $k$ times. 

A single cyclic shift to the left on any permutation $c$ is an operation that sets $c_1:=c_2, c_2:=c_3, \ldots, c_n:=c_1$ simultaneously. Likewise, a single cyclic shift to the right on any permutation $c$ is an operation that sets $c_1:=c_n, c_2:=c_1, \ldots, c_n:=c_{n-1}$ simultaneously.

Help Ishika and Hriday find the maximum number of pairs of elements that match after performing the operation any (possibly zero) number of times.


-----Input-----

The first line of the input contains a single integer $n$ $(1 \le n \le 2 \cdot 10^5)$ — the size of the arrays.

The second line contains $n$ integers $a_1$, $a_2$, ..., $a_n$ $(1 \le a_i \le n)$ — the elements of the first permutation.

The third line contains $n$ integers $b_1$, $b_2$, ..., $b_n$ $(1 \le b_i \le n)$ — the elements of the second permutation.


-----Output-----

Print the maximum number of matching pairs of elements after performing the above operations some (possibly zero) times.


-----Examples-----
Input
5
1 2 3 4 5
2 3 4 5 1

Output
5
Input
5
5 4 3 2 1
1 2 3 4 5

Output
1
Input
4
1 3 2 4
4 2 3 1

Output
2


-----Note-----

For the first case: $b$ can be shifted to the right by $k = 1$. The resulting permutations will be $\{1, 2, 3, 4, 5\}$ and $\{1, 2, 3, 4, 5\}$.

For the second case: The operation is not required. For all possible rotations of $a$ and $b$, the number of matching pairs won't exceed $1$.

For the third case: $b$ can be shifted to the left by $k = 1$. The resulting permutations will be $\{1, 3, 2, 4\}$ and $\{2, 3, 1, 4\}$. Positions $2$ and $4$ have matching pairs of elements. For all possible rotations of $a$ and $b$, the number of matching pairs won't exceed $2$.

Difficulty: interview

Starter code:

Solutions:
from collections import Counter

n = int(input())
a = [int(x) for x in input().split()]
b = [int(x) for x in input().split()]

aidx = [-1]*n
bidx = [-1]*n

for i, (ai, bi) in enumerate(zip(a, b)):
    aidx[ai-1] = i
    bidx[bi-1] = i

diffs = [(aidx[i] - bidx[i]) % n for i in range(n)]
print(max(Counter(diffs).values()))


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

diff = [0] * n
out = [0] * n
for i in range(n):
    diff[a[i]-1]+=i
for i in range(n):
    diff[b[i]-1]-=i
for v in diff:
    out[v] += 1
print(max(out))


from sys import stdin
input = stdin.readline

from collections import Counter

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

d = {j: i for i, j in enumerate(b)}

ds = []

for i in range(n):
    ds.append((d[a[i]] - i) % n)

print(max(Counter(ds).values()))

def read_int():
    return int(input())


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


n = read_int()
a = list(read_ints())
b = list(read_ints())
cnt = dict()
ad = dict()
bd = dict()
for i in range(n):
    ad[a[i]] = i
    bd[b[i]] = i
for i in range(1, n + 1):
    delta = (bd[i] - ad[i] + n) % n
    if not delta in cnt:
        cnt[delta] = 0
    cnt[delta] += 1
ans = 0
for key in cnt:
    ans = max(ans, cnt[key])
print(ans)


from collections import Counter

N = int(input())

A = [int(_) for _ in input().split()]
B = [int(_) for _ in input().split()]

posA = {}
for i, el in enumerate(A):
    posA[el] = i

cc = Counter()
for i, el in enumerate(B):
    diff = i - posA[el]
    if diff < 0:
        diff += N
    cc[diff] += 1

print(cc.most_common()[0][1])


n = int(input())
aa = list(map(int, input().split()))
aid = [0] * (n + 1)
for i, a in enumerate(aa):
    aid[a] = i
bb = list(map(int, input().split()))
dcount = [0] * n
for i, b in enumerate(bb):
    dcount[(i - aid[b]) % n] += 1
print(max(dcount))


import sys
from math import *
 
def input():
    return sys.stdin.readline().strip()
 
def iinput():
    return int(input())

def finput():
    return float(input())

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

def linput():
    return list(input())
 
def rinput():
    return map(int, tinput())

def fiinput():
    return map(float, tinput())
 
def rlinput():
    return list(map(int, input().split()))

def srlinput():
    return sorted(list(map(int, input().split())))
    
    
def main():
    n = iinput()
    #k = iinput() 
    #m = iinput() 
    #n = int(sys.stdin.readline().strip()) 
    #n, k = rinput()
    #n, m = rinput()
    #m, k = rinput()
    #n, k, m = rinput()
    #n, m, k = rinput()
    #k, n, m = rinput()
    #k, m, n = rinput() 
    #m, k, n = rinput()
    #m, n, k = rinput()
    #q = srlinput()
    q = rlinput()
    b = dict()
    o = 0
    for i in rlinput():
        b[i] = o
        o += 1
    res = [0 for i in range(n)]
    for i in range(n):
        res[i] = b[q[i]] - i
        if res[i] < 0:
            res[i] += n
    f = dict()
    for i in res:
        if i in f:
            f[i] += 1
        else:
            f[i] = 1
    z = 0
    for i, v in f.items():
        z = max(z, v)
    print(z)
        
        
    
    
    
    
for inytd in range(1):
    main()

from bisect import bisect_left as lower_bound, bisect_right as upper_bound
from sys import stdin, stdout
from collections import defaultdict

def solve(arr, n):
    pass

def main():
    n = int(input())
    a = list(map(int, input().strip().split()))
    b = list(map(int, input().strip().split()))

    ma = {i: [] for i in range(1, n+1)}

    for index,num in enumerate(a): ma[num].append(index)
    for index,num in enumerate(b): ma[num].append(index)

    cnt = {}
    ret = 0
    
    for i in range(1, n+1):
        diff = ma[i][1] - ma[i][0]

        if diff < 0: diff = n-abs(diff)

        cnt[diff] = cnt.get(diff, 0) + 1

        ret = max(ret, cnt[diff])

    print(ret)
        


def __starting_point(): main()

__starting_point()

from math import *
n = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
d = dict()
for i in range(n):
	d[a[i]] = i
dif = dict()
for i in range(n):
	x = (i - d[b[i]])%n
	if(x in dif):
		dif[x] += 1
	else:
		dif[x] = 1
print(max(dif.values()))

from collections import Counter
import sys
ints = (int(x) for x in sys.stdin.read().split())
sys.setrecursionlimit(3000)

def main():
    n = next(ints)
    A = [0]*n
    for i in range(n): A[next(ints)-1]=i
    b = [next(ints) for i in range(n)]
    ans = max(Counter((i-A[b[i]-1])%n for i in range(n)).values())
    print(ans)
    return

main()


n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = [0] * n
p = [0] * n
q = [0] * n
for i in range(n):
    p[a[i] - 1] = i
    q[b[i] - 1] = i
for i in range(n):
    c[(p[i] - q[i]) % n] += 1
print(max(c))

from collections import Counter
n = int(input())
t = [0] * n
for i, v in  enumerate(map(int, input().split())):
    t[v-1] = i
for i, v in  enumerate(map(int, input().split())):
    t[v-1] -= i
    t[v-1] %= n
print(max(Counter(t).values()))


from collections import Counter
from sys import stdin
input = iter(stdin.readlines()).__next__

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

ia = [0] * n
ib = [0] * n
for i, ai in enumerate(a):
    ia[ai - 1] = i
for i, bi in enumerate(b):
    ib[bi - 1] = i

diffs = [a_i - b_i for a_i, b_i in zip(ia, ib)]
for i, diff in enumerate(diffs):
    if diff < 0:
        diffs[i] = diff + n
counts = Counter(diffs)
print(counts.most_common(1)[0][1])


import sys
input=sys.stdin.readline
def N(): return int(input())
def NM():return map(int,input().split())
def L():return list(NM())
def LN(n):return [N() for i in range(n)]
def LL(n):return [L() for i in range(n)]
n=N()
a=L()
b=L()
d=dict()
for i,j in enumerate(a):
    d[j]=i
import collections
ans=collections.defaultdict(int)
for i,j in enumerate(b):
    ans[(d[j]-i)%n]+=1
print(max(ans.values()))

from sys import stdin
input = stdin.readline
n = int(input())
l1 = list(map(int,input().split()))
l2 = list(map(int,input().split()))
elt_to_pos1 = [0] * n
elt_to_pos2 = [0] * n
for i in range(n):
	elt_to_pos1[l1[i]-1] = i
	elt_to_pos2[l2[i]-1] = i
dupa = [0] * n
for i in range(n):
	if elt_to_pos1[i] <= elt_to_pos2[i]:
		dupa[elt_to_pos2[i]-elt_to_pos1[i]] += 1
	else:
		dupa[n-elt_to_pos1[i]+elt_to_pos2[i]] += 1
print(max(dupa))


# Below is Pythone code for input/output 
#comment this out when submiting 
  
import sys 
from collections import Counter




#########  utils 
def read_ints():
	return [int(i) for i in input().strip().split()]


def solve():
	#solves one test case 
	pass 

def intersection(left, right, mn, mx):
	#return [left, right ] or None 
	if right < mn or left > mx:
		return None 
	else:
		return [max(left, mn), min(right, mx)]


def main():
	n = int(input())
	a = read_ints()
	b = read_ints()
	#get all the diffs then find the mode 
	#make dict of val to index 
	# lineer pass to get diff array 
	d = dict()
	for idx, i in enumerate(a):
		d[i] = idx 
	diff = []
	for idx , i in enumerate(b):
		idx1 = d[i]
		delta = (idx1 - idx) % n 
		diff.append(delta)
	data = Counter(diff)
	print(data.most_common(1)[0][1])


	
	






def __starting_point():
	main()
	



__starting_point()