#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <queue>
#include <vector>
#define min(a,b)    (((a) < (b)) ? (a) : (b))
#define max(a,b)    (((a) > (b)) ? (a) : (b))
#define abs(x)    ((x) < 0 ? -(x) : (x))
#define INF 0x3f3f3f3f
#define delta 0.85
#define eps 1e-10
#define PI 3.14159265358979323846
using namespace std;

#define MAX_V 2000
int V;
vector<int> G[MAX_V];
int match[MAX_V];
bool used[MAX_V];

void add_edge(int u, int v){
	G[u].push_back(v);
	G[v].push_back(u);
}

bool dfs(int v){
	used[v] = true;
	for(int i = 0; i < G[v].size(); i++){
		int u = G[v][i], w = match[u];
		if(w < 0 || (!used[w] && dfs(w))){
			match[v] = u;
			match[u] = v;
			return true;
		}
	}
	return false;
}

int bipartite_matching(){
	int res = 0;
	memset(match, -1, sizeof(match));
	for(int v = 0; v < V; v++){
		if(match[v] < 0){
			memset(used, 0, sizeof(used));
			if(dfs(v)){
				++res;
			}
		}
	}
	return res;
}

#define MAX_N 100
#define MAX_L 1000
int N, M, L;
int dp[MAX_N][MAX_N];
int P[MAX_L], T[MAX_L];

void clear_graph(){
	for(int v = 0; v < V; v++) G[v].clear();
}

void floyd_warshall(){
	for(int k = 0; k < N; k++){
		for(int i = 0; i < N; i++){
			for(int j = 0; j < N; j++){
				dp[i][j] = min(dp[i][j], dp[i][k] + dp[k][j]);
			}
		}
	}
}

void solve(){
	floyd_warshall();
	V = 2 * L;
	clear_graph();
	
	for(int i = 0; i < L; i++){
		for(int j = i + 1; j < L; j++){
			if(dp[P[i]][P[j]] <= abs(T[j] - T[i])){
				if(T[i] <= T[j]) add_edge(i, L + j);
				else add_edge(j, L + i);
			}
		}
	}
	
	printf("%d\n", L - bipartite_matching());
}

int main(){
	while(~scanf("%d%d%d", &N, &M, &L) && (N | M | L)){
		memset(dp, 0x3f, sizeof(dp));
		for(int i = 0; i < N; i++) dp[i][i] = 0;
		for(int i = 0; i < M; i++){
			int u, v, d;
			scanf("%d%d%d", &u, &v, &d);
			dp[u][v] = dp[v][u] = d;
		}
		for(int i = 0; i < L; i++) scanf("%d%d", P + i, T + i);
		solve();
	}
	return 0;
}
