#include <iostream>
using namespace std;

#define SAFE_DELETE( x ) { if ( x ){ delete x; x = NULL; } }

struct tCell{
	tCell() : x( 0 ), prev( NULL ), next( NULL ){}
	int x;
	tCell *prev, *next;
};


class MyArray{
public:
	MyArray() : mSize( 0 ), head( NULL ), tail( NULL ){
		head = new tCell;
		tail = new tCell;
		head->next = tail;
		tail->prev = head;
	}
	~MyArray(){
		init();
		SAFE_DELETE( head );
		SAFE_DELETE( tail );
	}

	void init(){
		for ( int i = mSize; i > 0; --i ){
			tCell* it = tail->prev;
			it->prev->next = it->next;
			it->next->prev = it->prev;
			SAFE_DELETE( it );
		}
		mSize = 0;
	}

	void pushBack( int x ){
		tCell* it = new tCell;
		it->x = x;
		it->prev = tail->prev;
		it->next = tail;
		it->prev->next = it;
		it->next->prev = it;
		++mSize;
	}
	void pushAsc( int x ){
		
	}
	int size(){ return mSize; }

	tCell operator[]( int index ){
		tCell* it = head->next;
		for ( int i = 0; i < index; ++i ){
			it = it->next;
		}
		return *it;
	}

private:
	int mSize;
	tCell *head, *tail;
};

struct tData{
	tData() : done( false ){}

	bool done;
	MyArray to;
	MyArray dis;
};


class Route{
public:
	Route( int m ) : list( NULL ), mSize( m ){
		list = new tData[ mSize ];
	}
	~Route(){
		delete[] list;
	}

	int calc(){
		bool end;
		int ret = 0;
		list[ 0 ].done = true;
		do{
			end = true;
			int nextTo, nextDis = INT_MAX;
			for ( int i = 0; i < mSize; ++i ){
				if ( list[ i ].done ){
					for ( int j = 0; j < list[ i ].to.size(); ++j ){
						int to = list[ i ].to[ j ].x;
						if ( !list[ to ].done && list[ i ].dis[ j ].x < nextDis ){
							nextTo = to;
							nextDis = list[ i ].dis[ j ].x;
							end = false;
						}
					}
				}
			}
			if ( !end ){
				ret += nextDis / 100 - 1;
				list[ nextTo ].done = true;
			}
		}while ( !end );

		return ret;
	}

	int mSize;
	tData* list;
};

int main(){
	int n, m, p1, p2, d;
	char c;

	while ( cin >> n && n ){
		cin >> m;
		Route* route = new Route( m );
		for ( int i = 0; i < m; ++i ){
			cin >> p1 >> c >> p2 >> c >> d;
			route->list[ p1 ].to.pushBack( p2 );
			route->list[ p1 ].dis.pushBack( d );
			route->list[ p2 ].to.pushBack( p1 );
			route->list[ p2 ].dis.pushBack( d );
		}

		cout << route->calc() << endl;


		SAFE_DELETE( route );
	}
	return 0;
}