#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;

#define rep(i, n) REP(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for (int i = x; i < n; i++)
#define OP(m) cout << m << endl
typedef long long ll;
typedef unsigned long long ull;

int main()
{

    int n, m;
    while (cin >> n, n)
    {
        cin >> m;
        int M[n][n];
        rep(i, n) rep(j, n) M[i][j] = 1e7;
        rep(i, m)
        {
            char dot;
            int a, b, c;
            cin >> a >> dot >> b >> dot >> c;
            M[a][b] = c;
            M[b][a] = c;
        }

        int d[n], sum = 0;
        rep(i, n) d[i] = 1e7;

        d[0] = 0;
        bool used[n] = {};

        while (1)
        {
            int u = -1, minv = 1e7;

            rep(i, n)
            {
                if (!used[i] && d[i] < minv)
                {
                    minv = d[i];
                    u = i;
                }
            }
            if (u == -1)
                break;
            used[u] = true;

            sum += minv;
            rep(i, n)
            {
                if (!used[i] && M[u][i] != 1e7 && d[i] > M[u][i])
                    d[i] = M[u][i];
            }
        }
        OP(sum / 100 - (n - 1));
    }

    return 0;
}
