#!/usr/bin/env python3 import sys W = int(input()) H = int(input()) N = int(input()) match = set() hand = [] for line in sys.stdin: S, K = map(int, line.split()) hand.append((S, K)) match.update([(i, K) for i in range(1, W + 1)]) match.update([(S, i) for i in range(1, H + 1)]) match.difference_update(hand) print(len(match))