#include <iostream>
#include <algorithm>
#include <cassert>
#include <cctype>
#include <complex>
#include <cstdio>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;

struct edge{int u,v,cost;};

int par[100000],rank[100000],V,E,n,m,a,b,d;
edge es[100000];

void init(int n){for(int i=0;i<n;i++){par[i]=i;rank[i]=0;}}
int find(int x){if(par[x]==x)return x;else return find(par[x]);}
void unite(int x,int y){x=find(x);y=find(y);if(x==y)return;if(rank[x]<rank[y])par[x]=y;else{par[y]=x;if(rank[x]==rank[y])rank[x]++;}}
bool same(int x,int y){return find(x)==find(y);}

bool comp(const edge e1,const edge e2){return e1.cost<e2.cost;}

int kruskal(){
	sort(es,es+E,comp);
	init(V);
	int res=0;
	for(int i=0;i<E;i++){
		edge e=es[i];
		if(!same(e.u,e.v)){
			unite(e.u,e.v);
			res+=e.cost;
		}
	}
	return res;
}

int main(){
	while(cin>>n>>m){
		char com;
		for(int i=0;i<m;i++){
			cin>>a>>com>>b>>com>>d;
			es[i].u=a;es[i].v=b;es[i].cost=d/100-1;
		}
		V=n;
		E=m;
		cout<<kruskal()<<endl;
	}
}