#include <stdio.h>
#include <cmath>
#include <algorithm>
#include <cfloat>
#include <stack>
#include <queue>
#include <vector>
#include <string>
#include <iostream>
#include <set>
#include <map>
#include <time.h>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;

#define FIRST 100
#define NUM 2100
#define HUGE_NUM 9999999999999

struct Info{
	int house;
	ll time;
};


int N,M,L;
ll dist_table[FIRST][FIRST];
Info info[1000];

int V; //頂点数
vector<int> G[NUM];
int match[NUM];
bool used[NUM];

int boss[1000],height[1000];

int get_boss(int id){
	if(boss[id] == id)return id;
	else{
		return boss[id] = get_boss(boss[id]);
	}
}

int is_same(int x,int y){
	return get_boss(x) == get_boss(y);
}

void unite(int x,int y){
	int boss_x = get_boss(x);
	int boss_y = get_boss(y);

	if(boss_x == boss_y)return;

	if(height[x] > height[y]){

		boss[boss_y] = boss_x;

	}else if(height[x] < height[y]){

		boss[boss_x] = boss_y;

	}else{ //height[x] == height[y]

		boss[boss_y] = boss_x;
		height[x]++;
	}
}

void add_edge(int from,int to){
	G[from].push_back(to);
	G[to].push_back(from);
}

int dfs(int node_id){
	used[node_id] = true;

	for(int i = 0; i < G[node_id].size(); i++){
		int adj_node_id = G[node_id][i],pair_id = match[adj_node_id];
		if((pair_id < 0)||
				(used[pair_id] == false && dfs(pair_id) == true)){

			match[node_id] = adj_node_id;
			match[adj_node_id] = node_id;
			return true;
		}
	}
	return false;
}


int bipartie_matching(){
	int ret = 0;
	for(int i = 0; i < V; i++)match[i] = -1;
	for(int node_id = 0; node_id < V; node_id++){
		if(match[node_id] < 0){
			for(int i = 0; i < V; i++)used[i] = false;
			if(dfs(node_id)){
				ret++;
			}
		}
	}
	return ret;
}

void func(){

	for(int i = 0; i < N; i++){
		for(int k = 0; k < N; k++){
			if(i == k){
				dist_table[i][k] = 0;
			}else{
				dist_table[i][k] = HUGE_NUM;
			}
		}
	}

	int from,to;
	ll dist;

	for(int loop = 0; loop < M; loop++){
		scanf("%d %d %lld",&from,&to,&dist);
		dist_table[from][to] = dist;
		dist_table[to][from] = dist;
	}

	for(int mid = 0; mid < N; mid++){
		for(int start = 0; start < N; start++){
			if(dist_table[start][mid] == HUGE_NUM)continue;
			for(int end = 0; end < N; end++){
				if(dist_table[mid][end] == HUGE_NUM)continue;
				dist_table[start][end] = min(dist_table[start][end],dist_table[start][mid]+dist_table[mid][end]);
			}
		}
	}

	for(int i = 0; i < L; i++){
		scanf("%d %lld",&info[i].house,&info[i].time);
	}

	for(int i = 0; i < NUM; i++)G[i].clear();

	for(int i = 0; i < L; i++){
		for(int k = 0; k < L; k++){
			if(i == k || info[i].time >= info[k].time)continue;

			if(dist_table[info[i].house][info[k].house] <= info[k].time-info[i].time){
				add_edge(i,L+k);
			}
		}
	}

	V = 2*L;
	bipartie_matching();

	for(int i = 0; i < L; i++){
		boss[i] = i;
		height[i] = i;
	}

	int another;

	for(int i = 0; i < L; i++){
		if(match[i] == -1)continue;
		another = match[i]-L;
		unite(i,another);
	}

	int ans = 0;
	for(int i = 0; i < L; i++){
		if(get_boss(i) == i)ans++;
	}

	printf("%d\n",ans);
}


int main(){

	while(true){
		scanf("%d %d %d",&N,&M,&L);
		if(N == 0 && M == 0 && L == 0)break;

		func();
	}

	return 0;
}



Measured memory_bytes: 11532