Flandre Scarlet(フランドール·スカーレット) is a vampire of The Embodiment of Scarlet Devil. But she is unfortunate because she is always in the undercroft.
The undercroft has so many rooms signed as room, room, ... room[N][M].
Today she wants to go from the room to room[N][M]. Every room she can only go straight along the walls but some special rooms.
In the special rooms, she Flandre can go through it.
You can imagine that the length of every wall is 100.
Can you help Flandre to caculate out the minimum length she would go from the room to room[N][M]?
You can reference the picture below.
This problem has several cases.
The first line of each case contains 2 integers N and M (0 < N, M <= 100000).
Then follow a line that only contains an integer K (0 < K <= 2000), indicates the number of special rooms.
The next K lines stands for the coordinate X, Y(1 <= X <= N, 1 <= Y <= M) of each special room.
For each case, you only need to print the minimum length that Flandre would go from (1, 1) to (N, M). Round to the nearest integer.