#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < (int)(n); ++i)
const int INF = 1e9;

class bipartite_matching {
public:
    int n;
    vector<vector<int>> g;
    vector<int> match;

    bipartite_matching(int n_) : n(n_), g(n_), match(n_), used(n_) {}

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

    int maximum_matching(void) {
        int res = 0;
        fill(begin(match), end(match), -1);
        for(int v = 0; v < n; ++v){
            if (match[v] < 0) {
                fill(begin(used), end(used), false);
                if (dfs(v)) res++;
            }
        }
        return res;
    }

private:
    vector<int> used;
    bool dfs(int v) {
        used[v] = true;
        for (int u: g[v]) {
            int w = match[u];
            if (w < 0 || (!used[w] && dfs(w))) {
                match[v] = u; match[u] = v;
                return true;
            }
        }
        return false;
    }
};

int N,M,L;
int mat[110][110];
pair<int,int> node[1010];

int main(){
    cin.tie(0);
    ios::sync_with_stdio(0);
    while(cin >> N >> M >> L && N){
        rep(i,N)rep(j,N) mat[i][j] = (i == j ? 0 : INF);
        rep(i,M){
            int u,v,d;
            cin >> u >> v >> d;
            mat[u][v] = mat[v][u] = d;
        }
        rep(k,N)rep(i,N)rep(j,N) mat[i][j] = min(mat[i][j], mat[i][k]+mat[k][j]);
        rep(i,L) cin >> node[i].second >> node[i].first;
        sort(node, node+L);

        bipartite_matching bm(L*2);

        rep(i,L)rep(j,i){
            int dt = node[i].first - node[j].first;
            int dist = mat[node[i].second][node[j].second];
            if(dt >= dist){
                bm.add_edge(j, i+L);
            }
        }

        int f = bm.maximum_matching();
        cout << L-f << '\n';
    }
}