#include <string.h>
#include <algorithm>
#include <cstdio>
#include <limits>
#define max_n 100
#define max_m 1000
#define max_l 1000
#define   min_int(a,b)  ( ((a)<(b) ) ? (a) : (b) )
using namespace std;
class Req{
public:
  char house;
  int time;
};
class LessReq {
public:
    bool operator()(const Req& x, const Req& y) const {
        return x.time < y.time; 
    }
};
int n,m,l;
int dist[max_n][max_n];
Req reqs[max_l];
//????????¨??????x???????????????????????¨??????y????????????????????????????????°?????????DAG???
int req_graph[max_l][max_l];
int num_child[max_l];//???????????¨??????x???????????°
int parent[max_l]; //?¢??????????????????????????????¨??????x??????
int till[max_l];
bool visited[max_l];
int halfmax = (numeric_limits<int>::max())/2;
  
//????????????????????????????????¢????????????dist????¨????
void compute_dist(){
  register int i,j,k;
    
  for(k=0;k<n;k++){
    for(i=0;i<k;i++){
      for(j=i+1;j<k;j++){  //i<j<k
        dist[i][j] = min_int(dist[i][j],dist[i][k]+dist[j][k]);
      }
      for(j=k+1;j<n;j++){  //i<k<j
        dist[i][j] = min_int(dist[i][j],dist[i][k]+dist[k][j]);
      }
    }
    for(i=k+1;i<n;i++){
      for(j=i+1;j<n;j++){  //k<i<j
        dist[i][j] = min_int(dist[i][j],dist[k][i]+dist[k][j]);
      }      
    }
  }
  for(i=0;i<n;i++)for(j=i+1;j<n;j++){
    dist[j][i] = dist[i][j];
  }
}
//req_graph????§????
void compute_req_graph(){
  int i,j,h1,h2;
  
  memset(num_child,0,l*sizeof(int));
  for(i=0;i<l;i++) for(j=i+1;j<l;j++){
      h1 = reqs[i].house; h2 = reqs[j].house;      
      if((dist[h1][h2] != halfmax) //h1???h2??????????????????
         && (dist[h1][h2] <= reqs[j].time - reqs[i].time)){
        req_graph[i][num_child[i]++] = j;
      }      
  } 
}
  
int find(int i, bool root){
  int child, x, found;
  //????¨???????????????????????????¢???
  visited[i] = true;  
  if(till[i] < num_child[i]){    
    while((++(till[i])) < num_child[i]){
      child = req_graph[i][till[i]];
      if(parent[child] >= 0) continue;
      parent[child] = i; //child?????????????????¨??????
      return child;
    }
  }
  //???????????????????¨?????????£???????????????????????¢???  
  for(int j = 0;j < num_child[i]; j++){
    child = req_graph[i][j];
    x = parent[child]; //x: child??????????????????
    if(visited[x]) continue;
    found = find(x,false); //x??????child???????¨???????????????????
    if(found < 0) continue;
    parent[child] = i; //child???????¨???????
    return child;
  }
  return -1;
}
//req_graph??????????¢????????±????????¢??????°????????????
int num_covers(){
  int num=0;
  memset(till,-1,l*sizeof(int));
  memset(parent,-1,l*sizeof(int));
  for(int i=0;i<l;i++){
    memset(visited,0,l*sizeof(bool));
    find(i,true);
  }
  for(int i=0;i<l;i++) if(parent[i]<0) num++;
  return num;
}
  
//?????¬?????????????????????????????????????????°?????????????????¢??°
int santas(){
  int u,v,d,i,j;
  //??\???????????????
  for(i=0;i<n;i++) dist[i][i] = 0;
  for(i=0;i<n;i++) for(j=i+1;j<n;j++) dist[i][j] = halfmax;
  for(i=0;i<m;i++){
    scanf("%d%d%d",&u,&v,&d);
    dist[u][v] = d;
  }
  for(i=0;i<l;i++){
    scanf("%d%d",&(reqs[i].house),&(reqs[i].time));
  }
  compute_dist();//????????????house?????????????????¢????????????dist????¨????
  sort(reqs,reqs+l,LessReq());
  compute_req_graph();//req_graph????§????
  int res = num_covers();
  return res;
}
  
//??\??????????????¢??°
int main(){
  while(1){    
    scanf("%d%d%d",&n,&m,&l);
    if((n == 0) && (m == 0) && (l == 0)) break;    
    printf("%d\n",santas());
  }
  return 0;
}

Measured memory_bytes: 6680