#include <bits/stdc++.h>
using namespace std;
int g[15][15],cr[15][32768],ins[32768],dp[32768][15];
int main (){
	int i,j,k,t,u,v,c,l,n,m,s=0;
	scanf ("%d%d",&n,&m);
	for (i=1;i<=m;i++)
	{scanf ("%d%d%d",&u,&v,&c);
	u--;v--;g[u][v]=g[v][u]=c;s+=c;
	}
	for (i=0;i<n;i++)
	{for (k=0;k<n;k++)
	{for (j=0;j<(1<<n);j++)
	{if ((1<<k)&j) 
	{cr[i][j]+=g[i][k];}
	}
	}
	}
	for (i=0;i<(1<<n);i++)
	{for (j=0;j<n;j++)
	{for (k=0;k<n;k++)
	{if ((1<<j)&i)
	{if ((1<<k)&i)
	{ins[i]+=g[j][k];}
	}
	}
	}
	ins[i]/=2;
	}
	memset(dp,-1,sizeof(dp));
	dp[1][0]=0;
	for (i=1;i<(1<<n);i++)
	{for (j=0;j<n;j++)
	{if (dp[i][j]<0) {continue;}
	int tar=i-(1<<j),b=(1<<n)-1-i;
	for (k=0;k<n;k++)
	{if (i&(1<<k)) {continue;}
	if (g[j][k]<=0) {continue;}
	dp[i+(1<<k)][k]=max(dp[i+(1<<k)][k],dp[i][j]+g[j][k]);
	}
	for (t=b;t;t=(t-1)&b)
	{dp[t|i][j]=max(dp[t|i][j],dp[i][j]+cr[j][t]+ins[t]);}
	}
	}
	int ans=0;
	for (i=0;i<(1<<n);i++)
	{ans=max(ans,dp[i][n-1]);}
	printf ("%d",s-ans);
	return 0;
}
	
	
	
	