
import std.stdio;
import std.array;
import std.conv;
import std.math;
import std.algorithm;
void main()
{
  string[] input = split(readln());
  int w = to!int(input[0]), h = to!int(input[1]), n = to!int(input[2]), ans = 0;
  
  input = split(readln());
  int x = to!int(input[0]), y = to!int(input[1]);
  for(auto i = 0; i < n - 1; i++)
  {
    input = split(readln());
    int tx = to!int(input[0]), ty = to!int(input[1]);
    if(tx - x < 0 && ty - y < 0 || tx - x > 0 && ty - y > 0)
      ans += max(abs(tx - x), abs(ty - y));
    else
      ans += abs(tx - x) + abs(ty - y);
    x = tx;
    y = ty;
  }
  writeln(ans);
}