import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int w = sc.nextInt(); int h = sc.nextInt(); int n = sc.nextInt(); HashSet suits = new HashSet<>(); HashSet numbers = new HashSet<>(); for (int i = 0; i < n; i++) { suits.add(sc.nextInt()); numbers.add(sc.nextInt()); } long ans = suits.size() * ((long)h - numbers.size()) + numbers.size() * w - n; System.out.print(ans); } }