#include "bits/stdc++.h"
#define REP(i, n) for(int i = 0; i < int(n); i++)
#define FOR(i,n,m) for(int i = int(n); i < int(m); i++)
using namespace std;
typedef long long ll;
const int MOD = 1e9 + 7;
const int INF = 1e9 + 6;
const ll LLINF = 1e18 + 1;

// 最小全域木 O(ElogV)?
// verify : https://onlinejudge.u-aizu.ac.jp/problems/GRL_2_A
template<typename T>
struct Prim {
private:
    struct Edge {
        T cost;
        int to;
        bool operator>(const Edge e)const {
            return this->cost > e.cost;
        }
        bool operator<(const Edge e)const {
            return this->cost < e.cost;
        }
    };
    int V; // 頂点数
    vector<vector<Edge>> G;
public:
    Prim(int V) : V(V) {
        G.resize(V);
    }

    void add_edge(int from, int to, T weight) {
        G[from].push_back({weight,to});
        G[to].push_back({weight,from});
    }

    T build() {
        T res = 0;
        vector<bool> used(V, false);
        priority_queue<Edge, vector<Edge>, greater<Edge>> pq;
        for (const Edge &e : G[0]) {
            pq.push(e);
        }
        used[0] = true;
        while (!pq.empty()) {
            Edge e = pq.top(); pq.pop();
            if (used[e.to]) continue;
            used[e.to] = true;
            res += e.cost;
            for (const Edge &u : G[e.to]) {
                if (used[u.to]) continue;
                pq.push(u);
            }
        }
        return res;
    }
};

int main() {
    while (true) {
        int n, m; cin >> n;
        if (n == 0) break;
        cin >> m;
        Prim<ll> G(n);
        REP(i, m) {
            int a, b; ll c;
            char p;
            scanf("%d%c%d%c%lld", &a, &p, &b, &p, &c);
            G.add_edge(a, b, c / 100);
        }
        cout << G.build() - (n - 1) << endl;
    }
    return 0;
}
