#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define all(a) (a).begin(),(a).end()
#define pb emplace_back
#define INF (1e9+1)

#define MAX_N 10001

vector<pii> G[MAX_N];

int prim(int n){        //n : ノード数
    bool used[MAX_N];
    int mincost[MAX_N];
    
    rep(i,n){
        mincost[i]=INF;
        used[i]=false;
    }
    mincost[0]=0;
    int res=0;
    
    while(1){
        int v=-1;
        rep(u,n){
            if(used[u]==false && ( v==-1 || mincost[u]<mincost[v] ))
                v=u;
        }
        if(v==-1)break;
        used[v]=true;
        res+=mincost[v];
        
        rep(i,G[v].size()){
            int u = G[v][i].first;
            mincost[u] = min( mincost[u] , G[v][i].second);
        }
    }
    return res;
}

int main(){
    int v,e;
    while(cin>>v&&v){
        cin>>e;
        cin.ignore();
        rep(i,e){
            int u,v,d;
            scanf("%d,%d,%d",&u,&v,&d);
            G[u].pb(pii(v,d/100-1));
            G[v].pb(pii(u,d/100-1));
        }
        
        cout<<prim(v)<<endl;
    }
}

