2073 - 【NOIP2018】T2 龙虎斗

Input

Output

Examples

Input

6 
2 3 2 3 2 3 
4 6 5 2 

Output

2

Input

6 
1 1 1 1 1 16 
5 4 1 1

Output

1

Hint

Time Limit 1 second
Memory Limit 256 MB
Discuss Stats
上一题 下一题