#include <iostream>
#include <vector>
#include <cstring>
#include <cstdio>
using namespace std;

#define DO(n) for ( int ____n = n; ____n-->0; )
#define REP(i, n) for (int i=0;i<n;++i)
#define FOR(i, a, b) for (int i=a;i<b;++i)
#define DWN(i, b, a) for (int i=b-1;i>=a;--i)
#define REP_1(i, n) for (int i=1;i<=n;++i)
#define FOR_1(i, a, b) for (int i=a;i<=b;++i)
#define DWN_1(i, b, a) for (int i=b;i>=a;--i)
#define ECH(it, A) for (__typeof(A.begin()) it = A.begin(); it != A.end(); ++it)
#define RST(A) memset(A, 0, sizeof(A))
#define FLC(A, x) memset(A, x, sizeof(A))
#define PB push_back

template<class T> void checkMin(T &a, T b){if (b < a) a = b;}
template<class T> void checkMax(T &a, T b){if (b > a) a = b;}

typedef double DB;
typedef vector<int> VI;
const int INF = 0x3f3f3f3f;

const int N = int(1e2) + 9, NN = 16;
int G[N][N];
int n;

int Aid[NN], A[NN], An, ans;

bool ok(int v){
    REP(i, An){
        int u = Aid[i];
        if (!G[u][v]) return false;
    }
    return true;
}

void dfs(){

    if (An > 1){
        int cur = 0; REP(i, An) cur += A[i]; checkMax(ans, cur);
    }

    int AA[NN]; REP(i, An) AA[i] = A[i];
    int st = An ? Aid[An-1]+1 : 0;

    FOR(v, st, n){

        if (!ok(v)) continue;

        A[An] = INF; REP(i, An){
            int u = Aid[i];
            checkMin(A[i], G[u][v]);
            checkMin(A[An], G[u][v]);
        }

        if (!ok) continue;
        Aid[An] = v; ++An; dfs(); --An;
        REP(i, An) A[i] = AA[i];
    }
}

int main(){

#ifndef ONLINE_JUDGE
    //freopen("in.txt", "r", stdin);
    //freopen("out.txt", "w", stdout);
#endif

    int m; while (~scanf("%d%d", &n, &m)){

        RST(G); DO(m){
            int u, v, w; scanf("%d%d%d", &u, &v, &w); --u, --v;
            G[u][v] = G[v][u] = w;
        }

        ans = 0; dfs();
        printf("%d\n", ans);
    }
}