n = gets.chomp.to_i
x = gets.chomp.split(" ").map(&:to_i)
y = gets.chomp.split(" ").map(&:to_i)

Dxy=|x1???y1|+|x2???y2|+...+|xn???yn|

xy = [x, y].transpose

dist = 0
xy.each do | i, j |
  dist += ( i - j ).abs.to_f
end
puts dist

exit

puts x1???y1|+|x2???y2|+...+|xn???yn|

(2..n).each do | i |
end