#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<unsigned> index;
    static vector<int> level;
    static int n;

    class Func{
    public:
        static void bfs(int s){
            level.assign(n, -1);
            queue<int> q;
            level[s] = 0;
            q.push(s);
            while(!q.empty()){
                int v = q.front();
                q.pop();
                for(unsigned i=0; i<edges[v].size(); ++i){
                    Edge2& e = edges[v][i];
                    if(e.cap > 0 && level[e.to] < 0){
                        level[e.to] = level[v] + 1;
                        q.push(e.to);
                    }
                }
            }
        }
        static int dfs(int s, int t, int f){
            if(s == t)
                return f;
            for(unsigned& i=index[s]; i<edges[s].size(); ++i){
                Edge2& e = edges[s][i];
                if(e.cap > 0 && level[s] < level[e.to]){
                    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;
        }
    };

    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(;;){
        Func::bfs(source);
        if(level[sink] < 0)
            return ret;
        index.assign(n, 0);
        int f;
        while((f = Func::dfs(source, sink, INT_MAX)) > 0)
            ret += f;
    }

    return 0;
}

/***************************************************************************************************/
// ツ陳クツ点ツづー1ツ嘉アツつクツづつカツバツーツつキツづゥツパツスツづ個催渉ャツ本ツ青板づーツ仰づ淞づゥ
// dag : DAG
/***************************************************************************************************/
int coverNode(vector<vector<int> > dag)
{
    int n = dag.size();
    vector<vector<Edge2> > edges(2*n+2);
    for(int i=0; i<n; ++i){
        edges[0].push_back(Edge2(i+2, 1));
        edges[i+n+2].push_back(Edge2(1, 1));
    }
    for(int i=0; i<n; ++i){
        for(unsigned j=0; j<dag[i].size(); ++j){
            edges[i+2].push_back(Edge2(dag[i][j]+n+2, 1));
        }
    }
    return n - maxFlow(edges, 0, 1);
}

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<int> > edges2(l);
        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].push_back(j);
            }
        }

        cout << coverNode(edges2) << endl;
    }
}

Measured memory_bytes: 28000