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

int dp[123][123];
int n, m, l;
pair <int, int> work[1234];
vector<int> G[4567];
int result[4567], vis[4567];

bool dfs(int u)
{
    vis[u] = 1;
    for(int i = 0; i < G[u].size(); i++)
    {
        int t = G[u][i];
        if(result[t] == -1 || !vis[result[t]] && dfs(result[t]))
        {
            result[t] = u;
            result[u] = t;
            return true;
        }
    }
    return false;
}

int hungary()
{
    int res = 0;
    memset(result, -1, sizeof result);
    for(int i = 0; i < l; i++)
    {
        memset(vis, 0, sizeof vis);
        res += dfs(i);
    }
    return res;
}

int main()
{
    while(~scanf("%d%d%d", &n, &m, &l), n + m + l)
    {
        for(int i = 0; i < n; i++) for(int j = 0; j < n; j++) dp[i][j] = i == j ? 0 : 1000000000;
        for(int i = 0; i < m; i++)
        {
            int x, y, u;
            scanf("%d%d%d", &x, &y, &u);
            dp[x][y] = dp[y][x] = u;
        }
        for(int i = 0; i < l; i++)
        {
            int u, v;
            scanf("%d%d", &u, &v);
            work[i] = make_pair(u, v);
        }
        for(int k = 0; k < n; k++) for(int i = 0; i < n; i++) for(int j = 0; j < n; j++) dp[i][j] = min(dp[i][j], dp[i][k] + dp[k][j]);
        for(int i = 0; i < l; i++)
        {
            for(int j = 0; j < l; j++)
            {
                if(i == j) continue;
                if(dp[work[i].first][work[j].first] + work[i].second <= work[j].second)
                {
                    G[i].push_back(j + l);
                }
            }
        }
        printf("%d\n", l - hungary());
        for(int i = 0; i < l; i++) G[i].clear();
    }
    return 0;
}

/*

77 0 292
4 1934
29 2124
1 1825
68 1511
20 1672
46 1724
46 2124
66 2179
48 1426
62 1609
7 1795
4 2028
52 2026
32 1151
20 1609
32 1725
1 1040
52 1810
22 1151
30 1326
18 2179
65 2162
50 1673
29 1725
15 1205
59 2026
41 2200
1 2026
46 2163
49 1489
53 1489
32 1426
0 1156
59 1934
13 1673
18 2026
20 1825
1 1672
24 2124
48 2124
66 2162
39 1725
37 1933
52 1603
32 1695
12 2178
69 1006
74 1489
40 2026
35 1841
34 2028
0 2241
24 1671
21 1673
25 1279
57 1204
56 1603
6 2124
60 2163
1 1489
10 1212
66 2178
63 1243
71 2178
23 1671
50 1560
10 1825
8 2179
69 1810
40 1825
6 2178
22 1724
75 1796
58 983
19 2124
59 2179
62 2026
18 1279
61 1695
44 1153
52 1795
9 1796
74 2179
26 2026
45 1561
20 1151
48 1279
34 1724
50 1609
35 2178
40 1673
56 1204
70 1672
4 1695
63 934
45 1810
25 1673
61 1725
46 1825
31 2179
64 2026
32 1489
75 1673
49 2178
36 1426
25 969
75 2241
21 2200
44 1040
26 2124
62 1841
34 1795
9 1489
13 2178
43 1489
25 1609
3 1695
64 1811
15 1212
30 1795
28 2026
58 1243
60 2162
38 2124
23 2162
18 1795
54 934
48 1609
16 1326
27 1810
64 1511
12 2179
2 1841
45 1560
10 1489
60 1796
65 1796
49 1326
35 1561
11 1603
72 1212
20 1426
25 1810
45 2026
56 1671
64 1151
69 2026
4 1810
75 2124
22 1489
65 1811
55 1672
51 2241
1 2124
53 1671
36 1934
31 2026
76 934
31 1695
69 1795
24 1934
55 2241
41 2241
14 1933
34 2179
67 2241
12 1825
8 1672
13 2026
60 1156
7 1673
5 1489
69 1561
29 1561
53 2124
22 1934
25 1489
46 2179
46 1550
38 2179
28 1796
13 2179
67 1489
54 2241
40 1724
18 1368
48 2179
62 837
57 2124
69 2028
22 1152
64 2028
46 2026
47 1489
56 1933
70 1795
74 2124
10 2124
57 1205
58 1006
13 2124
36 2162
34 1695
66 1671
8 1841
5 1279
3 1151
11 2179
1 2178
48 1006
43 1609
47 1603
27 1205
47 1326
55 1673
35 2162
24 2179
18 2241
26 1151
54 1796
35 2124
1 1673
39 2028
64 2179
14 1243
18 1673
46 1810
25 2162
38 1243
26 1810
5 2178
14 1795
58 1673
61 1724
73 1825
12 1795
18 1796
38 1673
15 1489
47 1825
37 2026
67 1212
39 1724
25 1610
2 2241
72 992
10 903
27 2124
67 2026
52 1560
60 1671
26 2163
41 1156
25 1151
18 1672
48 1560
29 1560
6 2162
9 1279
28 1672
4 1426
45 1673
52 1811
26 1725
18 1671
17 1795
69 1811
22 1156
17 2124
2 1511
30 1695
10 1213
59 1933
35 1212
74 2028
48 1825
2 1561
53 2241
18 1933
50 1054
74 1795
63 1673
7 1426
32 1054
8 969
68 1934
55 1841
72 2179
51 1279
11 1560
23 2178
42 2241

*/

Measured memory_bytes: 5712