@staticmethod
def d():
    (w, h, n, *xy) = map(int, sys.stdin.read().split())
    (*xy,) = zip(*([iter(xy)] * 2))

    @lru_cache(maxsize=None)
    def count(x1, y1, x2, y2):
        res = 0
        for (x, y) in xy:
            if (not ((x1 <= x <= x2) and (y1 <= y <= y2))):
                continue
            cnt = (((x2 - x1) + (y2 - y1)) + 1)
            cnt += count(x1, y1, (x - 1), (y - 1))
            cnt += count(x1, (y + 1), (x - 1), y2)
            cnt += count((x + 1), y1, x2, (y - 1))
            cnt += count((x + 1), (y + 1), x2, y2)
            res = max(res, cnt)
        return res
    print(count(1, 1, w, h))
@staticmethod
def d():
    (w, h, n, *xy) = map(int, sys.stdin.read().split())
    (*xy,) = zip(*([iter(xy)] * 2))

    @lru_cache(maxsize=None)
    def count(x1, y1, x2, y2):
        res = 0
        for (x, y) in xy:
            if (not ((x1 <= x <= x2) and (y1 <= y <= y2))):
                continue
            cnt = (((x2 - x1) + (y2 - y1)) + 1)
            cnt += count(x1, y1, (x - 1), (y - 1))
            cnt += count(x1, (y + 1), (x - 1), y2)
            cnt += count((x + 1), y1, x2, (y - 1))
            cnt += count((x + 1), (y + 1), x2, y2)
            res = max(res, cnt)
        return res
    print(count(1, 1, w, h))