// Slower C++ solution:
#include <cstdio>

#include <string.h>

#define INF 99999999

using namespace std;



typedef struct {

    int num;

    int time;

}node;

int n,l;

int dis[105][105],w[1005][1005];

int linker[1005],vis[1005];

node no[1005];



void floyd() {

    for(int k = 0;k < n;k++)

        for(int i = 0;i < n;i++)

            for(int j = 0;j < n;j++)

                if(dis[i][k] < INF &&

                   dis[k][j] < INF &&

                   dis[i][j] > dis[i][k] + dis[k][j])

                   dis[i][j] = dis[i][k] + dis[k][j];

}



bool dfs(int u) {

    for(int v = 1;v <= l;v++)

        if(w[u][v] && !vis[v]) {

            vis[v] = 1;

            if(linker[v] == -1 || dfs(linker[v])) {

                linker[v] = u;

                return true;

            }

        }

    return false;

}



int hungary() {

    int res = 0;

    memset(linker,-1,sizeof(linker));

    for(int u = 1;u <= l;u++) {

        memset(vis,0,sizeof(vis));

        if(dfs(u)) res++;

    }

    return res;

}



int main() {

    int m;

    //freopen("test.in","r",stdin);

    while(~scanf("%d%d%d",&n,&m,&l) && (n + m + l)) {

        memset(w,0,sizeof(w));

        for(int i = 0;i < n;i++)

            for(int j = 0;j < n;j++) {

                dis[i][j] = INF;

                if(i == j) dis[i][j] = 0;

            }





        while(m--) {

            int a,b,val;

            scanf("%d%d%d",&a,&b,&val);

            dis[a][b] = val;

            dis[b][a] = val;

        }



        floyd();



        for(int i = 1;i <= l;i++)

            scanf("%d%d",&no[i].num,&no[i].time);



        for(int i = 1;i <= l;i++)

            for(int j = 1;j <= l;j++) {

            if(i == j) continue;

            int f = no[i].num,t = no[j].num;

            int ft = no[i].time,tt = no[j].time;

            if(ft + dis[f][t] <= tt) w[i][j] = 1;

        }



        printf("%d\n",l - hungary());

    }

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 11.836191200677586x):
#include <iostream>

#include <cstdio>

#include <vector>

#include <algorithm>

#include <cstring>

#include <string>

#include <map>

#include <queue>

#include <set>

#include <cmath>



#define PB push_back

#define LL long long

#define vi vector<int>

#define pii pair<int,int>

#define MP make_pair

#define pll pair<LL,LL>

using namespace std;



const int Maxn=110;

const int Maxv=1110;

int g[Maxn][Maxn],n,m,l;

int vis[Maxv],match[Maxv];

int head[Maxv],tot;

const int Inf=1e9+7;

struct Edge{

    int to,next;

}edge[Maxv*Maxv*2];



void init()

{

    memset(head,-1,sizeof(head));

    for(int i=0;i<Maxn;i++)

        for(int j=0;j<Maxn;j++)

            g[i][j]=i==j?0:Inf;

    tot=0;

}



void add_edge(int u,int v)

{

    edge[tot].to=v;

    edge[tot].next=head[u];

    head[u]=tot++;

}



void Floyed()

{

    for(int k=0;k<n;k++)

        for(int i=0;i<n;i++)

            for(int j=0;j<n;j++)

                g[i][j]=min(g[i][k]+g[k][j],g[i][j]);

}



bool dfs(int u,int tar)

{

    for(int i=head[u];~i;i=edge[i].next)

    {

        int v=edge[i].to;

        if(vis[v]==tar)

            continue;

        vis[v]=tar;

        if(match[v]==-1||dfs(match[v],tar))

        {

            match[v]=u;

            return true;

        }

    }

    return false;

}



int hungary()

{

    int ret=0;

    memset(match,-1,sizeof(match));

    memset(vis,-1,sizeof(vis));

    for(int i=0;i<l;i++)

    {

        ret+=dfs(i,i);

    }

    return ret;

}



pii op[Maxv];



bool cmp(pii a,pii b)

{

    return a.second<b.second;

}



int main()

{

    while(scanf("%d %d %d",&n,&m,&l),n||m||l)

    {

        init();

        while(m--)

        {

            int u,v,w;

            scanf("%d %d %d",&u,&v,&w);

            g[u][v]=g[v][u]=min(g[u][v],w);

        }

        Floyed();

        for(int i=0;i<l;i++)

        {

            int p,t;

            scanf("%d %d",&p,&t);

            op[i]=MP(p,t);

        }

        for(int i=0;i<l;i++)

        {

            for(int j=0;j<l;j++)

            {

                int p1=op[i].first,p2=op[j].first;

                int d=g[p1][p2];

                if(i==j)

                    continue;

                if(d==0&&op[i].second==op[j].second)

                    continue;

                if(op[i].second+d<=op[j].second)

                    add_edge(i,j);

            }

        }

        printf("%d\n",l-hungary());

    }

    return 0;

}