#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> l_l;
typedef pair<int, int> i_i;
template<class T>
inline bool chmax(T &a, T b) {
    if(a < b) {
        a = b;
        return true;
    }
    return false;
}

template<class T>
inline bool chmin(T &a, T b) {
    if(a > b) {
        a = b;
        return true;
    }
    return false;
}

const long double EPS = 1e-10;
const long long INF = 1e9;
const long double PI = acos(-1.0L);
//const ll mod = 1000000007;
int N, M, L;
vector<i_i> Queries;
vector<vector<ll>> dist;
vector<vector<ll>> paths;
bool visited[1005];

struct max_flow {
    int INF = 1e9;
    struct edge { int to, cap, rev; };
    int V;
    vector<vector<edge>> G;
    vector<int> itr, level;

    max_flow(int V) : V(V) { G.assign(V,vector<edge>()); }

    void add_edge(int from, int to, int cap) {
        G[from].push_back((edge) {to, cap, (int) G[to].size()});
        G[to].push_back((edge) {from, 0, (int) G[from].size()-1});
    }

    void bfs(int s) {
        level.assign(V,-1);
        queue<int> q;
        level[s] = 0; q.push(s);
        while (!q.empty()) {
            int v = q.front(); q.pop();
            for(auto &e: G[v]){
                if (e.cap > 0 and level[e.to] < 0) {
                    level[e.to] = level[v] + 1;
                    q.push(e.to);
                }
            }
        }
    }

    int dfs(int v, int t, int f) {
        if (v == t) return f;
        for (int& i = itr[v]; i < (int) G[v].size(); ++i) {
            edge& e = G[v][i];
            if (e.cap > 0 and level[v] < level[e.to]) {
                int d = dfs(e.to, t, min(f, e.cap));
                if (d > 0) {
                    e.cap -= d;
                    G[e.to][e.rev].cap += d;
                    return d;
                }
            }
        }
        return 0;
    }

    int run(int s, int t) {
        int ret = 0, f;
        while (bfs(s), level[t] >= 0) {
            itr.assign(V,0);
            while ((f = dfs(s, t, INF)) > 0) ret += f;
        }
        return ret;
    }
};

void dfs(int from, int to) {
    if(visited[to]) return;
    visited[to] = true;
    for(auto tmp : paths[to]) {
        dfs(from, tmp);
    }
}

void solve() {
    dist = vector<vector<ll>>(N, vector<ll>(N, INF));
    for(int i = 0; i < N; i++) dist[i][i] = 0;
    paths = vector<vector<ll>>(L);
    for(int i = 0; i < M; i++) {
        ll u, v, d;
        cin >> u >> v >> d;
        chmin(dist[u][v], d);
        chmin(dist[v][u], d);
    }
    for(int i = 0; i < N; i++) {
        for(int j = 0; j < N; j++) {
            for(int k = 0; k < N; k++) {
                chmin(dist[j][k], dist[j][i] + dist[i][k]);
            }
        }
    }
    Queries.resize(L);
    for(int i = 0; i < L; i++) {
        cin >> Queries[i].second >> Queries[i].first;
    }
    sort(Queries.begin(), Queries.end());
    for(int from = L - 1; from >= 0; from--) {
        for(int i = 0; i < L; i++) {
            visited[i] = false;
        }
        for(int to = from + 1; to < L; to++) {
            if(visited[to]) continue;
            if(Queries[to].first - Queries[from].first >= dist[Queries[to].second][Queries[from].second]) {
                paths[from].push_back(to);
                //dfs(from, to);
            }
        }
    }
    /*
    for(int i = 0; i < L; i++) {
        cerr << "----" << i << "---" << Queries[i].second << "---" << Queries[i].first << endl;
        for(auto to : paths[i]) {
            cerr << to << " ";
        }
        cerr << endl;
    }
    */
    max_flow graph(2 * L + 2);
    int s = 2 * L;
    int t = 2 * L + 1;
    for(int i = 0; i < L; i++) {
        graph.add_edge(s, i, 1);
        graph.add_edge(L + i, t, 1);
        for(auto to : paths[i]) {
            graph.add_edge(i, to + L, 1);
        }
    }
    cout << L - graph.run(s, t) << endl;
}

int main() {
    //cout.precision(10);
    cin.tie(0);
    ios::sync_with_stdio(false);
    while(cin >> N >> M >> L) {
        if(N == 0) break;
        solve();
    }
    return 0;
}


Measured memory_bytes: 23864