#include <iostream>
#include <algorithm>
using namespace std;


struct edge { int u, v, cost; };

bool comp(const edge& e1, const edge& e2) {
  return e1.cost < e2.cost;
}


const int MAX_N = 101;
const int MAX_E = 150;
int par[MAX_N];
int r[MAX_N];

void init(int n) {
  for ( int i = 0; i < n; i++ ) {
    par[i] = i;
    r[i] = 0;
  }
}

int find(int x) {
  if ( par[x] == x ) {
    return x;
  } else {
    return par[x] = find(par[x]);
  }
}

void unite(int x, int y ) {
  x = find(x);
  y = find(y);
  if ( x == y ) return;

  if ( r[x] < r[y] ) {
    par[x] = y;
  } else {
    par[y] = x;
    if ( r[x] == r[y] ) r[x]++;
  }
}

bool same(int x, int y) {
  return find(x) == find(y);
}



edge es[MAX_E];
int V, E;

int kruskal() {
  sort(es, es + E, comp);
  init(V);
  int res = 0;
  for ( int i = 0; i < E; i++ ) {
    edge e = es[i];
    if ( !same(e.u, e.v) ) {
      unite(e.u, e.v);
      res += e.cost;
    }
  }
  return res;
}

int main() {
  while( cin >> V >> E, V ) {

    for ( int i = 0; i < E; i++ ) {
      char ch;
      cin >> es[i].u >> ch >> es[i].v >> ch >> es[i].cost;
    }
  
    int ans = kruskal();
       cout << ((ans/100)-(V-1)) << endl;
  }
  return 0;
}