#include<bits/stdc++.h>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) range(i,0,b)
#define all(a) (a).begin(), (a).end()
#define debug(x) cout << "debug " << x << endl;
#define INF (1 << 30)
using namespace std;

const int kn = 105;
int atl[kn][kn];

int findMinPath(int n, vector<int> &v, bool isVisited[kn]){
    int mp, md = INF;
    rep(i,v.size()){
        rep(j,n){
            if(isVisited[j] == 0){
                if(md > atl[v[i]][j]){
                    md = atl[v[i]][j];
                    mp = j;
                }
            }
        }
    }
    isVisited[mp] = 1;
    v.push_back(mp);
    return md;
}

int PrimAlgorithm(int n){
    int sum = 0;
    bool isVisited[kn] = {0};
    vector<int> v;
    v.push_back(0);
    isVisited[0] = 1;

    while(not (v.size() == n)){
        sum += findMinPath(n, v, isVisited);
    }

    return sum;
}

int main(){
    int n, m;
    while(cin >> n >> m, n){
        rep(i,kn) rep(j,kn) atl[i][j] = INF;
        rep(i,m){
            int a, b, c;
            scanf("%d%*c%d%*c%d", &a, &b, &c);
            atl[a][b] = atl[b][a] = c;
        }
        cout << (PrimAlgorithm(n) / 100) - n + 1 << endl;
    }
}