#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<int, int>;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
const ld eps = 1e-9;
const ll MOD = 1000000007;
const int INF = 1000000000;
const ll LINF = 1ll<<50;
template<typename T>
void printv(const vector<T>& s) {
  for(int i=0;i<(int)(s.size());++i) {
    cout << s[i];
    if(i == (int)(s.size())-1) cout << endl;
    else cout << " ";
  }
}
template<typename T1, typename T2>
ostream& operator<<(ostream &os, const pair<T1, T2> p) {
  os << p.first << ":" << p.second;
  return os;
}
template<typename T>
struct edge {
    int src, to;
    T cost;
};
template<typename T>
using Graph = vector<vector<edge<T>>>;
template<typename T>
void warshall_floyd(vector<vector<T>> &g) {
    const auto INF = numeric_limits<T>::max();
    int n = g.size();
    for(int k = 0; k < n; k++) {
        for(int i = 0; i < n; i++) {
            for(int j = 0; j < n; j++) {
                if(g[i][k] == INF || g[k][j] == INF) continue;
                g[i][j] = min(g[i][j], g[i][k] + g[k][j]);
            }
        }
    }
}
struct HopcroftKarp {
    vector<vector<int>> g;
    vector<int> d, mch;
    vector<bool> used, vv;
    HopcroftKarp(int n, int m) : g(n), mch(m, -1), used(n) {}
    void add_edge(int u, int v) {
        g[u].push_back(v);
    }
    void bfs() {
        d.assign(g.size(), -1);
        queue<int> que;
        for (int i = 0; i < g.size(); i++) {
            if (!used[i]) {
                que.emplace(i);
                d[i] = 0;
            }
        }
        while (!que.empty()) {
            int a = que.front();
            que.pop();
            for (auto &b : g[a]) {
                int c = mch[b];
                if (c >= 0 && d[c] == -1) {
                    d[c] = d[a] + 1;
                    que.emplace(c);
                }
            }
        }
    }
    bool dfs(int a) {
        vv[a] = true;
        for (auto &b : g[a]) {
            int c = mch[b];
            if (c < 0 || (!vv[c] && d[c] == d[a] + 1 && dfs(c))) {
                mch[b] = a;
                used[a] = true;
                return (true);
            }
        }
        return (false);
    }
    int bipartite_matching() {
        int ret = 0;
        while (true) {
            bfs();
            vv.assign(g.size(), false);
            int flow = 0;
            for (int i = 0; i < g.size(); i++) {
                if (!used[i] && dfs(i)) ++flow;
            }
            if (flow == 0) return ret;
            ret += flow;
        }
    }
};
bool solve() {
  int n, m, l; cin >> n >> m >> l;
  if(n == 0) return false;
  vvi g(n, vi(n, INF));
  for(int i=0;i<n;++i) {
    g[i][i] = 0;
  }
  for(int i=0;i<m;++i) {
    int u, v, d; cin >> u >> v >> d;
    g[u][v] = d;
    g[v][u] = d;
  }
  warshall_floyd(g);
  vector<P> v(l);
  for(int i=0;i<l;++i) {
    cin >> v[i].second >> v[i].first;
  }
  sort(v.begin(), v.end());
  HopcroftKarp match(l, l);
  for(int i=0;i<l;++i) {
    for(int j=i+1;j<l;++j) {
      if(g[v[i].second][v[j].second] <= v[j].first - v[i].first) {
        match.add_edge(i, j);
      }
    }
  }
  cout << l - match.bipartite_matching() << endl;
  return true;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(10);
  while(1) {
    if(!solve()) break;
  }
}



Measured memory_bytes: 5512