#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < n; i++)
#define FOR(i, s, n) for(int i = s; i <= (int)n; ++i)
#define per(i, n) for(int i = n; i > 0; i--)
#define ROF(i, s, n) for(int i = s; i >= (int)n; i--)
#define FORIT(i, A) for (auto i : A)
#define PRINT(x) cout << (x) << "\n"
#define MP make_pair
#define PB push_back
#define EACH(i, n) for (__typeof((n).begin()) i = (n).begin(); i != (n).end(); ++i)
#define SZ(a) int((a).size())
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define CLR(a) memset((a), 0 ,sizeof(a))
#define NCLR(a) memset((a), -1 ,sizeof(a))
#define int long long
static const int dx[] = { -1, 0, 1, 0 };
static const int dy[] = { 0, -1, 0, 1 };

struct P{
    int edge;
    int cost;
};

int n,m;
int ans;
int E[150];
vector<P> V[150];
P p;

signed main(){
    while(1){
        cin>>n;
        if(n==0)break;
        cin>>m;
        rep(i,m){
            int x,y,z;
            char c;
            cin>>x>>c>>y>>c>>z;
            p={y,z};
            V[x].PB(p);
            p={x,z};
            V[y].PB(p);
        }
        rep(i,n){
            P res;
            res.cost=INT_MAX;
            rep(j,V[i].size()){
                if(E[i]==1&&E[V[i][j].edge]==1)continue;
                //cout<<V[i][j].cost<<" "<<V[i][j].edge<<endl;
                if(res.cost>V[i][j].cost){
                    res.cost=V[i][j].cost;
                    res.edge=V[i][j].edge;
                }
            }
            if(res.cost==INT_MAX)continue;
            ans+=res.cost-100;
            E[i]=1;
            E[res.edge]=1;
        }
        cout<<ans/100<<endl;
        rep(i,n)V[i].clear();
        memset(E,0,sizeof(E));

        ans=0;
    }
    return 0;
}