#include <iostream>
#include <cstring>
#include <vector>
#include <string>
#include <map>
#include <algorithm>

#define REP(i,n) for(int i=0;i<(int)(n);i++)

using namespace std;

#define MAX_V 3000
struct Edge{
  int src, dest;
  int cap, rev;
};

const int INF = 1000000000;

typedef vector<Edge> Edges;
typedef vector<Edges> Graph;
bool visited[MAX_V];

void add_edge(Graph &g, int src, int dest, int cap) {
  g[src].push_back((Edge){src, dest, cap, (int)g[dest].size()});
  g[dest].push_back((Edge){dest, src, 0, (int)g[src].size() - 1});
}

int dfs(Graph &g, int v, int t, int f) {
  if (v == t) return f;
  visited[v] = true;
  REP(i, g[v].size()) {
    Edge &e = g[v][i];
    if (!visited[e.dest] && e.cap > 0) {
      int d = dfs(g, e.dest, t, min(f, e.cap));
      if (d > 0) {
        e.cap -= d;
        g[e.dest][e.rev].cap += d;
        return d;
      }
    }
  }
  return 0;
}

int max_flow(Graph &g, int s, int t) {
  int flow = 0;
  for(;;) {
    memset(visited, 0, sizeof(visited));
    int f = dfs(g, s, t, INF);
    if (f == 0) return flow;
    flow += f;
  }
}

int main() {
  while(1){
    int n,m,l;
    cin>>n>>m>>l;
    if(!n)break;
    vector<vector<int>> b(n,vector<int>(n,INF));
    REP(i,m){
      int u,v,d;
      cin>>u>>v>>d;
      b[u][v] = d;
      b[v][u] = d;
    }
    REP(i,n) b[i][i] = 0;
    REP(k,n)REP(i,n)REP(j,n)
      b[i][j]=min(b[i][j], b[i][k]+b[k][j]);
    vector<pair<int,int>> q;
    REP(i,l){
      int p,t;
      cin>>p>>t;
      q.emplace_back(t,p);
    }
    sort(begin(q),end(q));
    Graph g(l*2+2);
    REP(i,l)REP(j,i){
      int ps,ts,pe,te;
      tie(ts,ps) = q[j];
      tie(te,pe) = q[i];
      if(b[ps][pe] <= te - ts) {
        add_edge(g, j + 1, i + l + 1, 1);
      }
    }
    REP(i,l){
      add_edge(g, 0, i+1, 1);
      add_edge(g, l+i+1, 2*l+1, 1);
    }
    int f = max_flow(g, 0, 2*l+1);
    cout << l - f << endl;
  }
  return 0;
}