#include <cstdio>
#include <iostream>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <climits>
#include <cfloat>
using namespace std;

class Edge1
{
public:
    int to, cost;
    Edge1(){};
    Edge1(int to0, int cost0){to = to0; cost = cost0;}
};

void shortestPath(const vector<vector<Edge1> >& edges, int start, vector<int>& dist)
{
    dist.assign(edges.size(), INT_MAX);
    dist[start] = 0;
    priority_queue<pair<int,int> ,vector<pair<int,int> >, greater<pair<int,int> > > q;
    q.push(make_pair(0, start));

    while(!q.empty()){
        pair<int, int> p = q.top();
        q.pop();
        int v = p.second;
        if(dist[v] < p.first)
            continue;
        for(unsigned i=0; i<edges[v].size(); ++i){
            Edge1 e = edges[v][i];
            if(dist[v] + e.cost < dist[e.to]){
                dist[e.to] = dist[v] + e.cost;
                q.push(make_pair(dist[e.to], e.to));
            }
        }
    }
}

void shortestPath(const vector<vector<Edge1> >& edges, vector<vector<int> >& dist)
{
    dist.resize(edges.size());
    for(unsigned i=0; i<edges.size(); ++i)
        shortestPath(edges, i, dist[i]);
}

class Edge2
{
public:
    int to, cap, rev;
    Edge2(){};
    Edge2(int to0, int cap0){to = to0; cap = cap0;}
    Edge2(int to0, int cap0, int rev0){to = to0; cap = cap0; rev = rev0;}
};

int maxFlow(const vector<vector<Edge2> >& edges0, int source, int sink)
{
    static vector<vector<Edge2> > edges;
    static vector<bool> used;

    class Func{
    public:
        static int dfs(int s, int t, int f){
            if(s == t)
                return f;
            used[s] = true;
            for(unsigned i=0; i<edges[s].size(); ++i){
                Edge2& e = edges[s][i];
                if(!used[e.to] && e.cap > 0){
                    int g = dfs(e.to, t, min(f, e.cap));
                    if(g > 0){
                        e.cap -= g;
                        edges[e.to][e.rev].cap += g;
                        return g;
                    }
                }
            }
            return 0;
        }
    };

    int n = edges0.size();
    edges.assign(n, vector<Edge2>());
    for(int i=0; i<n; ++i){
        for(unsigned j=0; j<edges0[i].size(); ++j){
            const Edge2& e = edges0[i][j];
            edges[i].push_back(Edge2(e.to, e.cap, edges[e.to].size()));
            edges[e.to].push_back(Edge2(i, 0, edges[i].size()-1));
        }
    }

    int ret = 0;
    for(;;){
        used.assign(n, false);
        int f = Func::dfs(source, sink, INT_MAX);
        if(f == 0)
            return ret;
        ret += f;
    }
}

int main()
{
    for(;;){
        int n, m, l;
        cin >> n >> m >> l;
        if(n == 0)
            return 0;

        vector<vector<Edge1> > edges1(n);
        for(int i=0; i<m; ++i){
            int u, v, d;
            cin >> u >> v >> d;
            edges1[u].push_back(Edge1(v, d));
            edges1[v].push_back(Edge1(u, d));
        }

        vector<vector<int> > dist;
        shortestPath(edges1, dist);

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

        vector<vector<Edge2> > edges2(2*l+2);
        for(int i=0; i<l; ++i){
            edges2[0].push_back(Edge2(i+2, 1));
            edges2[i+l+2].push_back(Edge2(1, 1));
        }
        for(int i=0; i<l; ++i){
            for(int j=i+1; j<l; ++j){
                if(dist[del[i].second][del[j].second] <= del[j].first - del[i].first)
                    edges2[i+2].push_back(Edge2(j+l+2, 1));
            }
        }

        int ret = l - maxFlow(edges2, 0, 1);
        cout << ret << endl;
    }
}

Measured memory_bytes: 24000