#include "bits/stdc++.h"

using namespace std;

using ll = long long;
using ld = long double;
using P = pair<int, int>;
constexpr ld EPS = 1e-12;
constexpr int INF = numeric_limits<int>::max() / 3;
constexpr int MOD = 1e9 + 7;

template <typename T>
void printv(const vector<T> &v)
{
    int sz = v.size();
    for (int i = 0; i < sz; i++)
    {
        cout << v[i] << " \n"[i == sz - 1];
    }
}

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

public:
    BipartiteMatching(int v) : size(v), g(v), match(v), used(v) {}
    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 < size; ++v)
        {
            if (match[v] >= 0)
                continue;
            fill(begin(used), end(used), 0);
            if (dfs(v))
                ++res;
        }
        return res;
    }
};

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);

    int n, m, l;
    while (cin >> n >> m >> l, n || m || l)
    {
        vector<vector<int>> dist(n, vector<int>(n, INF));
        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 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][k] + dist[k][j], dist[i][j]);
                }
            }
        }
        // place, time;
        vector<int> p(l), t(l);
        for (int i = 0; i < l; i++)
        {
            cin >> p[i] >> t[i];
        }
        BipartiteMatching bm(2 * l);
        for (int i = 0; i < l; i++)
        {
            for (int j = 0; j < l; j++)
            {
                if(i==j) continue;
                // i を処理してから j を処理できるか
                if (dist[p[i]][p[j]] <= t[j] - t[i])
                {
                    bm.add_edge(i, j + l);
                }
            }
        }
        //for(int i=0;i<n;i++)for(int j=0;j<n;j++) cout << i << " "<<j << " "<<dist[i][j]<<endl;
        // cout << bm.maximum_matching() << endl;
        cout << l - bm.maximum_matching() << endl;
    }
}

