#include <iostream>
using namespace std;

#define WHITE 0
#define GRAY 1
#define BLACK 2
#define INFTY 1000000000

int n,M[101][101],color[101],d[101],p[101];

void prim() {
  for ( int i = 0; i < 101; i++ ) {
    color[i] = WHITE;
    d[i] = INFTY;
    p[i] = -1;
  }
  
  d[0] = 0;
  int u;
  while(1){
    u = -1;
    int mincost = INFTY;

    for ( int i = 0; i < n; i++ ) {
      if ( color[i] != BLACK && d[i] < mincost ) {
	mincost = d[i];
	u = i;
      }
    }

    if ( u == -1 ) break;

    color[u] = BLACK;
    
    for ( int v = 0; v < n; v++ ) {
      if ( color[v] != BLACK && M[u][v] != INFTY ) {
	if ( M[u][v] < d[v] ) {
	  d[v] = M[u][v];
	  p[v] = u;
	  color[v] = GRAY;
	}
      }
    }
  }

  int ans = 0;

  for ( int i = 0; i < n; i++ ) {
    if ( p[i] != -1 ) {
      int tmp = d[i]/100-1;
      ans += tmp;
    }
  }
  cout << ans << endl;
}

int main() {

  while( cin >> n,n) {
    for ( int i = 0; i  < 101; i++ ) {
      for ( int j = 0; j < 101; j++ ) {
	M[i][j] = INFTY;
      }
    }
    int m; cin >> m;
    char ch;
    for ( int i = 0; i < m; i++ ) {
      int a,b,distance;
      cin >> a >> ch >> b >> ch >> distance;
      M[a][b] = distance;
      M[b][a] = distance;
    }
  
    prim();

  }
  
  return 0;
}