#include<bits/stdc++.h>
using namespace std;

const int M = 1000000007;

typedef pair<int, int> P;
struct edge { int to, cap, cost, rev; };

int V;
vector<edge> G[2010];
int h[2010];
int dist[2010];
int prevv[2010], preve[2010];
void add_edge(int from, int to, int cap, int cost) {
    G[from].push_back((edge){ to, cap, cost, (int)G[to].size() });
    G[to].push_back((edge){ from, 0, -cost, (int)G[from].size() - 1 });
}

int min_cost_flow(int s, int t, int f) {
    int res = 0;
    fill(h, h + V, 0);
    while (f > 0) {
        priority_queue<P, vector<P>, greater<P> > q;
        fill(dist, dist + V, M);
        dist[s] = 0;
        q.push(P(0, s));
        while (!q.empty()) {
            P p = q.top();
            q.pop();
            int v = p.second;
            if (dist[v] < p.first) continue;
            for (int i = 0; i < (int)G[v].size(); ++i) {
                edge &e = G[v][i];
                if (e.cap > 0 && dist[e.to] > dist[v] + e.cost + h[v] - h[e.to]) {
                    dist[e.to] = dist[v] + e.cost + h[v] - h[e.to];
                    prevv[e.to] = v;
                    preve[e.to] = i;
                    q.push(P(dist[e.to], e.to));
                }
            }
        }
        if (dist[t] == M) return M;
        for (int v = 0; v < V; ++v)
            h[v] += dist[v];

        int d = f;
        for (int v = t; v != s; v = prevv[v])
            d = min(d, G[prevv[v]][preve[v]].cap);

        f -= d;
        res += d * h[t];
        for (int v = t; v != s; v = prevv[v]) {
            edge &e = G[prevv[v]][preve[v]];
            e.cap -= d;
            G[v][e.rev].cap += d;
        }
    }
    return res;
}


int main() {
    while (1) {
        int n, m, l;
        cin >> n >> m >> l;
        if (!n) return 0;

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

        }
        vector<vector<int>> dist(n, vector<int>(n, M));
        for (int i = 0; i < n; ++i) {
            dist[i][i] = 0;
        }
        for (int i = 0; i < m; ++i) {
            int u, v, d;
            cin >> u >> v >> d;
            dist[u][v] = 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)
                    dist[j][k] = min(dist[j][k], dist[j][i] + dist[i][k]);

        vector<pair<int, int>> p(l);
        for (int i = 0; i < l; ++i) {
            cin >> p[i].second >> p[i].first;
        }
        sort(p.begin(), p.end());

        V = l * 2 + 2;
        for (int i = 0; i < l; ++i) {
            add_edge(l * 2, i, 1, 0);
            add_edge(i, l + i, 1, -1);
            add_edge(l + i, l * 2 + 1, 1, 0);
        }
        for (int i = 0; i < l; ++i) {
            for (int j = i + 1; j < l; ++j) {
                if (dist[p[i].second][p[j].second] <= p[j].first - p[i].first) {
                    add_edge(l + i, j, 1, 0);
                }
            }
        }
        int c = 0;
        for (int i = 1; ; ++i) {
            c += -min_cost_flow(l * 2, l * 2 + 1, 1);
            if (c == l) {
                cout << i << "\n";
                goto A;
            }
        }
        A:
        continue;
    }
}

Measured memory_bytes: 28016