// Original C++ solution (slower):
#include <cstdio>

#include <string.h>

#define INF 99999999

using namespace std;



typedef struct {

    int num;

    int time;

}node;

int n,l;

int dis[105][105],w[1005][1005];

int linker[1005],vis[1005];

node no[1005];



void floyd() {

    for(int k = 0;k < n;k++)

        for(int i = 0;i < n;i++)

            for(int j = 0;j < n;j++)

                if(dis[i][k] < INF &&

                   dis[k][j] < INF &&

                   dis[i][j] > dis[i][k] + dis[k][j])

                   dis[i][j] = dis[i][k] + dis[k][j];

}



bool dfs(int u) {

    for(int v = 1;v <= l;v++)

        if(w[u][v] && !vis[v]) {

            vis[v] = 1;

            if(linker[v] == -1 || dfs(linker[v])) {

                linker[v] = u;

                return true;

            }

        }

    return false;

}



int hungary() {

    int res = 0;

    memset(linker,-1,sizeof(linker));

    for(int u = 1;u <= l;u++) {

        memset(vis,0,sizeof(vis));

        if(dfs(u)) res++;

    }

    return res;

}



int main() {

    int m;

    //freopen("test.in","r",stdin);

    while(~scanf("%d%d%d",&n,&m,&l) && (n + m + l)) {

        memset(w,0,sizeof(w));

        for(int i = 0;i < n;i++)

            for(int j = 0;j < n;j++) {

                dis[i][j] = INF;

                if(i == j) dis[i][j] = 0;

            }





        while(m--) {

            int a,b,val;

            scanf("%d%d%d",&a,&b,&val);

            dis[a][b] = val;

            dis[b][a] = val;

        }



        floyd();



        for(int i = 1;i <= l;i++)

            scanf("%d%d",&no[i].num,&no[i].time);



        for(int i = 1;i <= l;i++)

            for(int j = 1;j <= l;j++) {

            if(i == j) continue;

            int f = no[i].num,t = no[j].num;

            int ft = no[i].time,tt = no[j].time;

            if(ft + dis[f][t] <= tt) w[i][j] = 1;

        }



        printf("%d\n",l - hungary());

    }

    return 0;

}

// Optimized solution to the same problem (faster):
#include<bits/stdc++.h>

using namespace std;

struct edge{ int to,cap,rev; };

class Max_Flow{

public:

	vector<vector<edge>>G;

	vector<bool>used;int size__;

	void init(int _size){ G.resize(_size); used.resize(_size); size__=_size; }

	void add_edge(int from,int to,int cap){

		G[from].push_back((edge){to,cap,(int)G[to].size()});

		G[to].push_back((edge){from,0,(int)G[from].size()-1});

	}

	int dfs(int v,int t,int f){

		if(v==t)return f;

		used[v]=true;

		for(int i=0;i<G[v].size();i++){

			edge &e=G[v][i];

			if(!used[e.to] && e.cap>0){

				int d=dfs(e.to,t,min(t,e.cap));

				if(d>0){

					e.cap-=d;

					G[e.to][e.rev].cap+=d;

					return d;

				}

			}

		}

		return 0;

	}

	int max_flow(int s,int t){

		int ret=0;

		while(true){

			for(int j=0;j<size__;j++)used[j]=false;

			int f=dfs(s,t,1000000007);

			if(f==0)return ret;

			ret+=f;

		}

		return ret;

	}

};



int N,M,L,a,b,c,d[100][100],e1[1000],e2[1000];

int main(){

	while(true){

		cin>>N>>M>>L;if(N+M+L==0)break;

		for(int i=0;i<N;i++){for(int j=0;j<N;j++)d[i][j]=1e9;d[i][i]=0;}

		for(int i=0;i<M;i++){

			cin>>a>>b>>c;

			d[a][b]=c;d[b][a]=c;

		}

		for(int k=0;k<N;k++){for(int i=0;i<N;i++){for(int j=0;j<N;j++){d[i][j]=min(d[i][j],d[i][k]+d[k][j]);}}}

		for(int i=0;i<L;i++){

			cin>>e1[i]>>e2[i];

		}

		Max_Flow X;

		X.init(2*L+2);

		for(int i=0;i<L;i++){

			for(int j=0;j<L;j++){

				if(i==j || d[e1[i]][e1[j]]>e2[j]-e2[i])continue;

				X.add_edge(i,j+L,1);

			}

		}

		for(int i=0;i<L;i++){X.add_edge(2*L,i,1);}

		for(int i=0;i<L;i++){X.add_edge(i+L,2*L+1,1);}

		cout<<L-X.max_flow(2*L,2*L+1)<<endl;

	}

	return 0;

}

// Fastest known solution for this problem: