#include <iostream>
#include <cstdio>
#include <cassert>
#include <cstring>
#include <vector>
#include <valarray>
#include <array>
#include <queue>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <algorithm>
#include <cmath>
#include <complex>
#include <random>
 
using namespace std;
typedef long long ll;
 
/**
 * F-F ??????????????¨?????????????????¨
 */
template<int V>
struct MaxFlow {
    struct Edge {
        int to, rev, cap;
    };
    vector<Edge> g[V];
    /// ?????????
    void init() {
        for (int i = 0; i < V; i++) {
            g[i].clear();
        }
    }
    /// ??????????????????
    void add(int from, int to, int cap) {
        g[from].push_back(Edge{to, (int)g[to].size(), cap});
        g[to].push_back(Edge{from, (int)g[from].size()-1, 0});
    }
    /// ??????????????????
    /// ??????????????¨?????????, ??????1??????2????????????????????????????????????
    void add_multi(int from, int to, int cap) {
        g[from].push_back(Edge{to, (int)g[to].size(), cap});
        g[to].push_back(Edge{from, (int)g[from].size()-1, cap});
    }

    int erase(int from, int to) {
        for (int i = 0; i < (int)g[from].size(); i++) {
            auto e = g[from][i];
            if (e.to == to) {
                int c = g[to][e.rev].cap - e.cap;
                g[to].erase(g[to].begin()+e.rev);
                g[from].erase(g[from].begin()+i);
                return c;
            }
        }
        assert(false);
    }

    bool used[V];
    bool dfs(int s, int t) {
        if (s == t) return true;
        used[s] = true;
        for (auto &e : g[s]) {
            if (used[e.to]) continue;
            if (!e.cap) continue;
            if (dfs(e.to, t)) {
                e.cap -= 1;
                g[e.to][e.rev].cap += 1;
                return true;
            }
        }
        return false;
    }
    int exec(int s, int t, int F) {
        int f = 0;
        while (f < F) {
            fill_n(used, V, false);
            if (!dfs(s, t)) break;
            f++;
        }
        return f;
    }
    void print() {
        for (int i = 0; i < V; i++) {
            for (auto &e: g[i]) {
                printf("(%d %d %d)\n", i, e.to, e.cap);
            }
        }
    }
};

 
typedef pair<int, int> P;
const int MN = 110;
const int ML = 1100;
MaxFlow<ML*2> mf;
 
int dist[MN][MN];
P qu[ML];
bool solve() {
    mf.init();
    int n, m, l;
    cin >> n >> m >> l;
    if (!n) return false;
    for (int i = 0; i < MN; i++) {
        for (int j = 0; j < MN; j++) {
            if (i == j) dist[i][j] = 0;
            else dist[i][j] = 1e8;
        }
    }
    for (int i = 0; i < m; i++) {
        int u, v, d;
        cin >> u >> v >> d;
        dist[u][v] = d;
        dist[v][u] = d;
    }
    for (int k = 0; k < n; k++) {
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < n; j++) {
                dist[i][j] = min(dist[i][j],
                    dist[i][k]+dist[k][j]);
            }
        }
    }
 
 
    for (int i = 0; i < l; i++) {
        int p, t;
        cin >> p >> t;
        qu[i] = P(t, p);
    }
    sort(qu, qu+l);
 
    int vs = 2*ML-1;
    int vt = 2*ML-2;
    for (int i = 0; i < l; i++) {
        for (int j = i+1; j < l; j++) {
            int ap, at, bp, bt;
            tie(at, ap) = qu[i];
            tie(bt, bp) = qu[j];
            if (dist[ap][bp] <= bt - at) {
                mf.add(i, j+ML, 1);
            }
        }
    }
    for (int i = 0; i < l; i++) {
        mf.add(vs, i, 1);
        mf.add(i+ML, vt, 1);
    }
    cout << l - mf.exec(vs, vt, 100000) << endl;
    return true;
}
 
int main() {
    while (true) {
        if (!solve()) break;
    }
    return 0;
}

Measured memory_bytes: 17084