import java.util.Arrays; import java.util.HashSet; import java.util.Scanner; class Main { public static void main(String[] args) { new Main().run(); } void run() { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int[][] dist = new int[n][n]; int m = sc.nextInt(); for (int i = 0; i < m; ++i) { int a = sc.nextInt(); int b = sc.nextInt(); int c = sc.nextInt(); --a; --b; dist[a][b] = Math.max(dist[a][b], c); dist[b][a] = dist[a][b]; } long[][] dp = new long[1 << n][n]; for (int i = 0; i < dp.length; ++i) Arrays.fill(dp[i], -Integer.MAX_VALUE / 3); for (int i = 0; i < n; ++i) dp[1 << i][i] = 0; for (int s = 0; s < 1 << n; ++s) { for (int src = 0; src < n; ++src) { if ((s & (1 << src)) == 0) continue; for (int dst = 0; dst < n; ++dst) { if ((s & (1 << dst)) > 0) continue; if (dist[src][dst] == 0) continue; dp[s | (1 << dst)][dst] = Math.max(dp[s | (1 << dst)][dst], dp[s][src] + dist[src][dst]); } } } long ans=0; for(int i=0;i