// Arup Guha
// 2/19/2024
// Solution to UCF HS Online Problem: Perilous Passage

import java.util.*;
import java.io.*;

public class passage {

	final public static int MAX = 100000;
	
	public static void main(String[] args) throws Exception {
	
		BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
		
		// Will store the radius of the monsters at each time period.
		int[] monsters = new int[MAX+1];
		Arrays.fill(monsters,-1);
		
		// Will store x-values of starting ships.
		ArrayList<Integer>[] start = new ArrayList[MAX+1];
		for (int i=0; i<=MAX; i++) start[i] = new ArrayList<Integer>();
		
		// Will store x-values of ending ships.
		ArrayList<Integer>[] end = new ArrayList[MAX+1];
		for (int i=0; i<=MAX; i++) end[i] = new ArrayList<Integer>();
		
		StringTokenizer tok = new StringTokenizer(stdin.readLine());
		int dist = Integer.parseInt(tok.nextToken());
		int numS = Integer.parseInt(tok.nextToken());
		int numA = Integer.parseInt(tok.nextToken());
		
		// Read each ship.
		for (int i=0; i<numS; i++) {
		
			// Get data.
			tok = new StringTokenizer(stdin.readLine());
			int x = Integer.parseInt(tok.nextToken());
			int s = Integer.parseInt(tok.nextToken());
			int e = Integer.parseInt(tok.nextToken());
			
			// This is how we store it.
			start[s].add(x);
			end[e].add(x);
		}
		
		// Read each monster awakening.
		for (int i=0; i<numA; i++) {
			tok = new StringTokenizer(stdin.readLine());
			int t = Integer.parseInt(tok.nextToken());
			int r = Integer.parseInt(tok.nextToken());
			
			/*** This is an error, in my opinion, in the data. It really
			     doesn't make any earthly sense for the monsters to 
				 awaken at the same time multiple times. Technically, it's
				 not forbidden in the data, but it really makes no sense.
				 So, what you have to do is just take the maximum of these
				 radii. Again, the data should have disallowed two entries
				 where the value of t was the same. As having two entries
				 is contradictory. But, the data had these, so I just put
				 the max function in to match the judge's answers.
			***/
			monsters[t] = Math.max(monsters[t], r);
		}
		
		// Store answer here.
		int res = 0;
		
		// Active ships stored here.
		TreeSet<Integer> ships = new TreeSet<Integer>();
		
		// Simulate events in time.
		for (int t=0; t<=MAX; t++) {
			
			// First process starting ships.
			for (Integer x: start[t]) ships.add(x);
			
			// Next have the monsters eat stuff.
			if (monsters[t] > -1) {
				
				// Scylla eats.
				while (ships.size() > 0 && ships.first() <= monsters[t])
					ships.pollFirst();
				
				// Charybdis eats.
				while (ships.size() > 0 && ships.last() >= dist - monsters[t])
					ships.pollLast();
			}
			
			// See if any ship made it through at this time step.
			for (Integer x: end[t]) {
				if (ships.contains(x)) {
					res++;
					ships.remove(x);
				}
			}
		}
		
		// Ta da!
		System.out.println(res);
	}
}