#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <sstream>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <numeric>
#include <cctype>
#include <tuple>
#include <array>
#include <climits>
#include <bitset>
#include <cassert>

#ifdef _MSC_VER
#include <agents.h>
#endif

#define FOR(i, a, b) for(int i = (a); i < (int)(b); ++i)
#define rep(i, n) FOR(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define REV(v) v.rbegin(), v.rend()
#define MEMSET(v, s) memset(v, s, sizeof(v))
#define UNIQUE(v) (v).erase(unique(ALL(v)), (v).end())
#define MP make_pair
#define MT make_tuple

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int, int> P;

class bipartite_graph{
	vector<vector<int> > Graph;
	vector<int> used, match;
	int V;
public:
	bipartite_graph(int size) :V(size){
		Graph.resize(V);
		used.resize(V, 0);
		match.resize(V, -1);
	}
	void add_edge(int from, int to){
		Graph[from].push_back(to);
		Graph[to].push_back(from);
	}
	int dfs(int v){
		used[v] = 1;
		for (int i = 0; i < Graph[v].size(); i++){
			int x = Graph[v][i], w = match[x];
			if (w < 0 || !used[w] && dfs(w)){
				match[x] = v;
				match[v] = x;
				return 1;
			}
		}
		return 0;
	}
	int matching(){
		fill(match.begin(), match.end(), -1);
		int res = 0;
		for (int v = 0; v < V; v++){
			if (match[v] >= 0) continue;
			fill(used.begin(), used.end(), 0);
			if (dfs(v)) res++;
		}
		return res;
	}
};

const int N = 110;
int dist[N][N];

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	cout.setf(ios::fixed);
	cout.precision(20);

	int n, m, l;
	while (cin >> n >> m >> l, n){
		rep(i, n) rep(j, n) dist[i][j] = i == j ? 0 : 1e9;
		rep(i, m){
			int a, b, c;
			cin >> a >> b >> c;
			dist[a][b] = dist[b][a] = c;
		}
		rep(i, n) rep(j, n) rep(k, n) dist[j][k] = min(dist[j][k], dist[j][i] + dist[i][k]);

		vector<pair<int, int>> v(l);
		rep(i, l){
			int pos, t;
			cin >> pos >> t;
			v[i] = MP(t, pos);
		}
		sort(ALL(v));
	
		bipartite_graph G(l*2);
		rep(i, l) FOR(j, i + 1, l){
			int a = v[i].second, b = v[j].second;
			if (v[i].first + dist[a][b] <= v[j].first) G.add_edge(i, j + l);
		}

		cout << l - G.matching() << '\n';
	}
}