eolymp
bolt
Try our new interface for solving problems

TC100

Tank armada of countries lined up Tsuripopii \textbf{M} to \textbf{N} columns of tanks in each. The tanks were model "\textbf{TS-100}" (\textbf{T}ank \textbf{100}-year old), so could either move simultaneously in the same direction in a straight line, or simultaneously turn on a dime at the same angle multiple of \textbf{90}°. The dictator, who staggered under the throne, decided to hold a parade to scare the international community. After the command "\textit{As machines!}" and "\textit{Start the engines!}" Some engines do not tank bred and, therefore, some of them could not participate in the parade. What is the maximum number of tanks that are simultaneously moved from the place, can be seen on the parade a dictator? \InputFile The program reads a space of \textbf{M}, \textbf{N} (\textbf{1} ≤ \textbf{M}, \textbf{N} ≤ \textbf{200}) and the number of stationary tanks (\textbf{0} ≤ \textbf{K} ≤ \textbf{M·N}), then through a gap \textbf{K} of pairs of distinct numbers \textbf{X}, \textbf{Y}, respectively, number of columns and the position number in the column each tank. \OutputFile The program displays only the required number.
Time limit 0.5 seconds
Memory limit 64 MiB
Input example #1
5 4 7 1 3 2 3 2 1 2 4 5 3 4 4 4 2
Output example #1
9