#include<bits/stdc++.h>
using namespace std;

typedef long long int ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pair<int, int> > vii;
#define rrep(i, m, n) for(int (i)=(m); (i)<(n);  (i)++)
#define erep(i, m, n) for(int (i)=(m); (i)<=(n); (i)++)
#define  rep(i, n)    for(int (i)=0; (i)<(n);  (i)++)
#define rrev(i, m, n) for(int (i)=(n)-1; (i)>=(m); (i)--)
#define erev(i, m, n) for(int (i)=(n); (i)>=(m); (i)--)
#define  rev(i, n)    for(int (i)=(n)-1; (i)>=0; (i)--)
#define vrep(i, c)    for(__typeof((c).begin())i=(c).begin(); i!=(c).end(); i++)
#define  ALL(v)       (v).begin(), (v).end()
#define pb            push_back
#define mp            make_pair
template<class T, class S> inline bool minup(T& m, const S x){ return m>(T)x ? (m=(T)x, true) : false; }
template<class T, class S> inline bool maxup(T& m, const S x){ return m<(T)x ? (m=(T)x, true) : false; }

static const int    INF = 1000000000;
static const ll     MOD = 1000000007LL;
static const double EPS = 1E-10;

class BipartiteMatching
{
private:
  int MAX_V;
  vector<int>* G;
  int* match;
  int* used;

  bool dfs(int v)
  {
    used[v] = true;
    rep(i, G[v].size()){
      int u = G[v][i], w = match[u];
      if(w < 0 || !used[w] && dfs(w)){
        match[v] = u;
        match[u] = v;
        return true;
      }
    }
    return false;
  }

public:
  BipartiteMatching(int MAX_V) : MAX_V(MAX_V)
  {
    G = new vector<int>[MAX_V];
    match = new int[MAX_V];
    used = new int[MAX_V];
  }

  void addEdge(int u, int v)
  {
    G[u].pb(v);
    G[v].pb(u);
  }

  int matching()
  {
    int res = 0;
    rep(i, MAX_V) match[i] = -1;
    rep(v, MAX_V){
      if(match[v] < 0){
        rep(i, MAX_V) used[i] = 0;
        if(dfs(v)) res += 1;
      }
    }
    return res;
  }
};

int N, M, L;
int u, v, dd;
int d[111][111];
int p[1111];
int t[1111];

int main(int argc, char *argv[])
{
  while(cin >> N >> M >> L, N){
    BipartiteMatching bm = BipartiteMatching(2 * L);
    rep(i, N) rep(j, N) d[i][j] = INF;
    rep(i, N) d[i][i] = 0;
    rep(i, M){
      cin >> u >> v >> dd;
      d[u][v] = dd;
      d[v][u] = dd;
    }
    rep(k, N) rep(i, N) rep(j, N) minup(d[i][j], d[i][k] + d[k][j]);
    rep(i, L) cin >> p[i] >> t[i];
    rep(i, L) rep(j, L) if(i != j && t[i] + d[p[i]][p[j]] <= t[j]) bm.addEdge(i, j + L);
    cout << L - bm.matching() << endl;
  }
  
  return 0;
}