#include <bits/stdc++.h>

using namespace std;

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

int main ()
{
	int N , M;
	while( cin >> N , N )
	{
		cin >> M;
		priority_queue < PP , vector<PP> , greater<PP>>que;
		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 ) ) );
		}
		vector<bool>data(N);
		int count = 0;
		while( que.size () )
		{
			PP now = que.top (); que.pop ();
			if( data[now.second.first] == false || data[now.second.second] == false )
			{
				data[now.second.first] = true;
				data[now.second.second] = true;
				count += now.first / 100 - 1;
			}
		}
		cout << count << endl;
	}
}