#include using namespace std; #define REP(i,n) for(int i=0; i<(int)(n); i++) #define FOR(i,b,e) for (int i=(int)(b); i<(int)(e); i++) #define ALL(x) (x).begin(), (x).end() const double PI = acos(-1); int n, m; bool fr[100][100]; bool ok[100][100]; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cin >> n >> m; REP (i, m) { int a, b; cin >> a >> b; --a, --b; fr[a][b] = fr[b][a] = true; } REP (i, n) REP (j, i) { bool ck = false; REP (k, n) { if (k == i || k == j) continue; if (fr[i][k] && fr[k][j]) ck = true; } ok[i][j] = ok[j][i] = !ck || fr[i][j]; } int ret = 0; REP (i, n) REP (j, i) REP (k, j) { if (ok[i][j] && ok[j][k] && ok[k][i]) ++ret; } cout << ret << endl; return 0; }