#include <vector>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <algorithm>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <string>
#include <cstring>
#include <complex>
#include <ctime>
#include <cstdlib>

using namespace std;

inline int to_int(string s) {int v; istringstream sin(s); sin >> v; return v;}
template<class T> inline string to_str(T x) {ostringstream sout; sout << x; return sout.str();}

typedef long long ll;
const int INF = 1 << 28;

int main()
{
	int dist[101][101], mincost[101];
	bool used[101];

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

	while(cin >> n ,n)
	{
		int total = 0;
		
		cin >> m;
		for(int i = 0; i < n; i++)
		{
			for(int j = 0; j < n; j++)
			{
				dist[i][j] = INF;

				if(i == j)
				{
					dist[i][j] = 0;
				}
			}
			used[i] = false;
			mincost[i] = INF;
		}
		for(int i = 0; i < n; i++)
		{
			scanf("%d%*c%d%*c%d", &a, &b, &c);
			c /= 100; c -= 1;
			dist[a][b] = c; dist[b][a] = c;
		}

		mincost[0] = 0;

		while(1)
		{
			int v = -1;
			for(int i = 0; i < n; i++)
			{
				if(!used[i] && (v == -1 || mincost[i] < mincost[v])) v = i;
			}
			if(v == -1)
			{
				break;
			}

			used[v] = true;
			total += mincost[v];

			for(int i = 0; i < n; i++)
			{
				mincost[i] = min(mincost[i], dist[v][i]);
			}
		}
	
		cout << total << endl;
	}
}