#include <iostream>
#include <sstream>
#include <algorithm>
#include <queue>
#include <utility>
#include <vector>
#include <string>
using namespace std;

const int N_MAX = 100;
const int INF = (int)1e9;

struct Edge {
    int to, cost;
    Edge(int t, int c) : to(t), cost(c) {}
    bool operator <(const Edge &e) const {
        return cost > e.cost;
    }
};

bool used[N_MAX];

int main() {
    for(int N; cin >> N, N; ) {
        int M; cin >> M;
        cin.ignore();

        vector<Edge> D[N_MAX];

        for(int i = 0; i < M; i++) {
            string s; getline(cin, s);
            for(int j = 0; j < (int)s.length(); j++) if(s[j] == ',') s[j] = ' ';
            istringstream is(s);
            int a, b, cost;
            is >> a >> b >> cost;

            D[a].push_back(Edge(b, cost / 100 - 1));
            D[b].push_back(Edge(a, cost / 100 - 1));
        }

        fill(used, used + N, false);

        priority_queue<Edge> Q;
        Q.push(Edge(0, 0));

        int total = 0;

        while(!Q.empty()) {
            Edge e = Q.top(); Q.pop();

            if(used[e.to]) continue;

            used[e.to] = true;
            total += e.cost;

            for(Edge ne : D[e.to]) {
                if(used[ne.to]) continue;
                Q.push(ne);
            }

        }

        cout << total << endl;
    }
}