Tinky-Winky is playing a game of modular Tetris on a field with columns. Each column can hold between zero and three blocks. If a fourth block is added to a column, all four blocks in that column disappear. In one move, Tinky-Winky can select any number of consecutive columns, from to , and add one block to each selected column, as illustrated in the figure.
Starting from the current block configuration on the field, Tinky-Winky aims to reach a specified target configuration in the fewest possible moves.

Your task is to write a program that calculates the minimum number of moves required for Tinky-Winky to transform the initial configuration into the target configuration.
The input begins with an integer (1 \le N \le 1000), representing the number of columns on the Tetris field. The second line contains integers, each ranging from to , which describe the initial configuration of blocks. The third line also contains integers from to , representing the target configuration of blocks. Note that the initial and target configurations are different.
Output a single integer, which is the minimum number of moves Tinky-Winky needs to reach the target configuration.
Example 1