For a planned attack on settlements inhabited by humans, elves, and dwarves, the Horde's leader, Orgrim Doomhammer, organized all available warriors into distinct units and dispatched them for conquest. However, scouts have just returned with updated information about the enemy forces in these settlements, prompting Orgrim to revise his strategy. He now wants to redistribute troops among the units by transferring warriors from one unit to another. To avoid disorder and make the redistribution as quick as possible, the number of such transfers must be minimized (each transfer consists of moving one soldier from one unit to another).
Write a program that determines the minimum number of transfers required to achieve the desired redistribution of troops.
The first line contains an integer (1 \le N \le 10000) — the number of units.
The second line contains the initial distribution of warriors across the units: integers, each giving the number of warriors in the corresponding unit.
The third line contains the required (target) distribution of soldiers.
The number of soldiers in any unit does not exceed 10^6. It is guaranteed that the total number of warriors in the initial distribution equals the total in the required distribution.
Output the minimum number of transfers needed.
Example 1
Example 2