w, h, n = gets.chomp.split.map(&:to_i)
arr = []
n.times{arr << gets.chomp.split.map(&:to_i)}
prev_x, prev_y, sum = arr[0][0], arr[0][1], 0
arr[1..-1].each{|x, y|
    d_x = x - prev_x
    d_y = y - prev_y
    sum += d_x.abs + d_y.abs
    sum -= [d_x.abs, d_y.abs].min if d_x * d_y > 0
    x, y = prev_x, prev_y
}
puts sum
