#include <iostream>
#include <algorithm>
#include <string>
#include <sstream>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <cstring>
#include <cmath>
#include <cstdio>

using namespace std;

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define ALL(c) (c).begin(),(c).end()
#define MP make_pair
#define PB push_back

typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
const double EPS = 1e-9;
const int INF = 1<<28;
const double PI = acos(-1.0);
const int dx[] = {0,1,0,-1};
const int dy[] = {1,0,-1,0};

bool vpos(int x,int y,int w,int h){return 0<=x&&x<w&&y>=0&&y<h;}

typedef pair<int,pair<int,int> > E;

struct UnionFind{
    vector<int> par;
    UnionFind(int n){
        REP(i,n)par.push_back(i);
    }

    int find(int x){
        if(par[x]==x)return x;
        return par[x] = find(par[x]);
    }

    void union_(int x,int y){
        x = find(x);
        y = find(y);
        par[x] = y;
    }

    bool same(int x,int y){
        return find(x) == find(y);
    }
};

int main(){
    for(;;){
        int n,m;
        vector<E> es;
        cin >> n >> m;
        if(!n)break;
        UnionFind uf(n);
        REP(i,m){
            char conma;
            int a,b,d;
            cin >> a >> conma >> b >> conma >> d;
            es.PB(MP(d,MP(a,b)));
        }
        int sum = 0;
        sort(ALL(es));
        for(int i=0;i<m;i++){
            E e = es[i];
            int a = e.second.first;
            int b = e.second.second;
            int d = e.first;
            if(uf.same(a,b))continue;
            uf.union_(a,b);
            sum+=d/100-1;
        }
        cout << sum << endl;
        return 0;
    }
}