#include <cstdio>
#include <queue>
#include <algorithm>
using namespace std;

const int INF = 1<<29;

const int MAX_V = 100000;

//union-find tree defenition

int par[MAX_V];

void init(int n){
    fill(par, par+n, -1);
}

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

bool same(int a, int b){
    return find(a) == find(b);
}

bool unite(int a, int b){
    int xa = find(a), xb = find(b);
    if(xa == xb) return false;
    if(par[xa] < par[xb]){
        par[xb] = xa;
    }else{
        if(par[xa] == par[xb]){
            par[xb]--;
        }
        par[xa] = xb;
    }
    return true;
}

//END union-find tree definition

struct edge{
    int from;
    int to;
    int cost;
    edge(){}
    ~edge(){}
    edge(int a, int b, int c) : from(a), to(b), cost(c){}
    bool operator < (const edge& r) const {
        return cost < r.cost;
    }
};

vector<edge> G;
int V;

void append_edge(int from, int to, int cost){
    G.push_back(edge(from, to, cost));
}

int kruskal(void){
    init(V);
    sort(G.begin(), G.end());
    int ret = 0;
    for(int i = 0; i < G.size(); i++){
        if(unite(G[i].from, G[i].to)){
            ret += G[i].cost;
        }
    }
    return ret;
}

int main(){
    int m, a, b, c;
    while(scanf("%d%d", &V, &m) && V){
        G.clear();
        for(int x = 0; x < m; x++){
            scanf("%d,%d,%d", &a, &b, &c);
            append_edge(a, b, c / 100 - 1);
        }
        int res = kruskal();
        printf("%d\n", res);
    }
    return 0;
}