Account Book#6927

Account Book

1 second
64 megabytes
Very easy

Given a sequence of natural numbers. It is possible to perform the following operations on this sequence:

  1. For any (1 \leq i \leq n), replace A_i with A_i + 1.

  2. For any (1 \leq i \leq n), replace A_i with A_i - 1.

Your task is to find the minimum number of operations needed to transform the given sequence into the sequence , where is also a sequence of natural numbers and is given.

Input

The first line contains the integer (1 \leq n \leq 1000) — the length of the sequences.

The second line contains natural numbers — the sequence .

The third line contains natural numbers — the sequence .

Output

Output a single integer — the minimum number of operations required to transform into .

Examples

Example 1

Loading
Loading