require 'set'

def warshall_floyd(dist_matrix)
	dist = dist_matrix
	n = dist.size

	next_dist = (1..n).map{ Array.new(n) }	
	(0..n-1).each{|k|
		dist_k = dist[k]
		(0..n-1).each{|i|
			dist_i = dist[i]
			next_dist_i = next_dist[i]
			(0..n-1).each{|j|
				x = dist_i[j]
				y = dist_i[k] + dist_k[j]
				next_dist_i[j] = (x < y ? x : y)
			}
		}
		dist = next_dist
	}
	dist
end

loop do
	n, m, l = gets.split.map(&:to_i)
	break if n == 0
	dist_mat = (1..n).map { [Float::INFINITY] * n }
	(0..n-1).each {|i| dist_mat[i][i] = 0}
	m.times do
		u, v, d = gets.split.map(&:to_i)
		dist_mat[u][v] = d
		dist_mat[v][u] = d
	end
	dist = warshall_floyd(dist_mat)
	
	requests = (1..l).map { gets.split.map(&:to_i) }
	requests.sort_by!(&:last)
	
	#path cover in DAG
	g = {}
	(-1..2*l).each { |i| g[i] = Set.new }
	(0..l-1).each { |i| g[-1] << i }
	(l..2*l-1).each { |i| g[i] << 2*l }

	(0..l-1).to_a.combination(2) do |r1, r2|
		u, t1 = requests[r1]
		v, t2 = requests[r2]
		if dist[u][v] <= t2 - t1
			g[r1] << l + r2
		end
	end	

	matching = 0
	loop do
		prev = {-1 => -2}
		stack = [-1]
		until stack.empty?
			u = stack.pop
			g[u].each do |v|
				next if prev[v]
				prev[v] = u
				stack << v
			end
		end
		break if ! prev[2*l]
		matching += 1
		path = [2*l]
		path << prev[path[-1]] until prev[path[-1]] == -2
		path.each_cons(2) do |v, u|
			g[u].delete(v)
			g[v] << u
		end
	end
	p l - matching
end