#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define pb push_back
struct EDGE
{
    int to, cost;
    bool operator < (const EDGE& t) const {
        return cost > t.cost;
    }
};
vector<EDGE> v[100]; 
bool f[100];
int search()
{
    int res = 0;
    priority_queue<EDGE> que;
    que.push({0, 0});
    while (!que.empty()){
        EDGE e = que.top(); que.pop();
        if (f[e.to]) continue;
        f[e.to] = true;
        res += e.cost;
        rep(i, v[e.to].size()){
            if (!f[v[e.to][i].to]){
                que.push(v[e.to][i]);
            }
        }
    }
    return res;
}

int main()
{
    int n, m;
    while (scanf("%d", &n), n){
        scanf("%d", &m);
        rep(i,m){
            int a, b, c;
            scanf("%d%d%d",&a,&b,&c);
            a--; b--;
            c = c / 100 - 1;
            v[a].pb({b, c});
            v[b].pb({a, c});
        }
        printf("%d", search());
        memset(f, false, sizeof(f));
        rep(i, n) v[i].clear();
    }
    return 0;
}