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

int main() {

  int n,m,a,b,l;
  char c;

  vector<int> list;

  while(true) {

    cin >> n;
    if ( n == 0 ) break;

    cin >> m;

    int ans = 0;
    int cnt = 0;
    int flag_num = 1;

    int map[100][100] = {0};
    int flag[100] = {0};

    for ( int i = 0; i < m; i++ ) {

      cin >> a >> c >> b >> c >> l;
      map[a][b] = l;
      map[b][a] = l;
      list.push_back( l );

    }

    sort( list.begin(), list.end() );

    int num[100] = {0};

    while(true) {

      for ( int x = 0; x < n-1; x++ ) {
	for ( int y = x+1; y < n; y++ ) {

	  if ( map[x][y] != list[0] ) continue;

	  if ( flag[x] > 0 && flag[y] > 0 ) {     //その木の両端が両方とも連結済みだったら
	    if ( flag[x] != flag[y] ) {
	      int k = flag[y];
	      for ( int i = 0; i < n; i++ ) {
		if ( flag[i] == k ) flag[i] = flag[x];
	      }
	      ans += map[x][y]/100-1;
	      cnt++;
	    }
	  }else if ( flag[x] == 0 && flag[y] == 0 ) {
	    flag[x] = flag_num;
	    flag[y] = flag_num;
	    flag_num++;
	    ans += map[x][y]/100-1;
	    cnt++;
	  }else {
	    if ( flag[x] == 0 ) {
	      flag[x] = flag[y];
	      ans += map[x][y]/100-1;
	      cnt++;
	    }else {
	      flag[y] = flag[x];
	      ans += map[x][y]/100-1;
	      cnt++;
	    }
	  }

	  vector<int>::iterator it = list.begin();
	  list.erase( it );
	  map[x][y] = 0;
	  if ( cnt == n-1 ) break;

	}
	if ( cnt == n-1 ) break;
      }
      if ( cnt == n-1 ) break;

    }

    cout << ans << endl;

  }

  return 0;

}