#include <bits/stdc++.h>

using namespace std;

typedef  pair < int , pair<int , int> > PP;

template<typename T>
class UF
{
public:
	UF ()
	{
		count = 0;
	}

	void push ( T a )
	{
		M[a] = count;
		V.push_back ( count );
		rank.push_back ( 0 );
		count++;
	}

	void unite ( T a , T b )
	{
		long long int x = find ( M[a] );
		long long int y = find ( M[b] );
		if( x == y )return;
		if( rank[x] < rank[y] )
		{
			V[x] = y;
		} else
		{
			V[y] = x;
			if( rank[x] == rank[y] )rank[x]++;
		}
	}
	void merge ( T a , T b )
	{
		unite ( a , b );
	}
	bool same ( T a , T b )
	{
		return find ( M[a] ) == find ( M[b] );
	}
	long long int group ()
	{
		set<long long int>S;
		for( long long int i = 0; i < V.size (); i++ )
		{
			S.insert ( find ( V[i] ) );
		}
		return S.size ();
	}

private:
	vector<long long int> V , rank;
	map < T , long long int>M;
	long long int count;

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

int main ()
{
	int N , M;
	while( cin >> N , N )
	{
		cin >> M;
		priority_queue < PP , vector<PP> , greater<PP>>que;
		UF<int> uf;
		for( size_t i = 0; i < N; i++ )
		{
			uf.push ( i );
		}
		for( size_t i = 0; i < M; i++ )
		{
			char x;
			int a , b , c;
			cin >> a >> x >> b >> x >> c;
			que.push ( PP ( c , pair<int , int> ( a , b ) ) );
		}
		int count = 0;
		while( que.size () )
		{
			PP now = que.top (); que.pop ();
			if( uf.same ( now.second.first , now.second.second ) )continue;
			uf.merge ( now.second.first , now.second.second );
			count += now.first / 100 - 1;

		}
		cout << count << endl;
	}
}