w, h, n = gets.split.map(&:to_i)
x, y = gets.split.map(&:to_i)

ans = 0
(n - 1).times do
    nx, ny = gets.split.map(&:to_i)
    v = [(nx - x).abs, (ny - y).abs]
    ans += v.inject(:+) - ((nx - x) * (ny - y) > 0 ? v.min : 0)
    x, y = nx, ny
end
puts ans