#include<iostream>
#include<queue>
#include<cstring>
using namespace std;
int main()
{
  int n;
  for(;cin>>n,n;)
    {
      int edge[n][n];
      int m;
      cin>>m;
      memset(edge,-1,sizeof(edge));
      for(int i=0;i<m;i++)
	{
	  int a,b,road;
	  char buf;
	  cin>>a>>buf>>b>>buf>>road;
	  edge[a][b]=road/100-1;
	  edge[b][a]=road/100-1;
	}
      bool closed[n];
      int cnt=n;
      int ans=0;
      memset(closed,true,sizeof(closed));
      priority_queue<pair<int,int>,vector<pair<int,int> >,greater<pair<int,int> > > qu;
      closed[0]=false;
      for(int i=0;i<n;i++)
	if(edge[0][i]!=-1)
	  {
	    qu.push(make_pair(edge[0][i],i));
	  }
      //      cout<<"start"<<endl;
      for(;!qu.empty();)
	{
	  int node=qu.top().second;
	  int cost=qu.top().first;
	  qu.pop();
	  if(!closed[node])
	    continue;
	  //	  cout<<node<<" "<<cost<<endl;
	  // cout<<cnt<<" "<<ans<<endl;
	  closed[node]=false;
	  ans+=cost;
	  cnt--;
	  if(cnt<=0)
	    break;
	  for(int i=0;i<n;i++)
	    if(edge[node][i]!=-1)
	      qu.push(make_pair(edge[node][i],i));
	}
      cout<<ans<<endl;
    }
  
}