import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); long w = sc.nextInt(); long 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 wCount = suits.size(); long hCount = numbers.size(); long ans = wCount * h + hCount * w - wCount * hCount - n; System.out.println(ans); } }