/** * @FileName a.cpp * @Author kanpurin * @Created 2020.08.10 04:15:48 **/ #include "bits/stdc++.h" using namespace std; typedef long long ll; int main() { int n,m;cin >> n >> m; vector> g(n); for (int i = 0; i < m; i++) { int u,v;cin >> u >> v; u--; v--; g[v].push_back(u); g[u].push_back(v); } vector> st(n); for (int i = 0; i < n; i++) { vector used(n,-1); queue que; que.push(i); used[i] = 0; while(!que.empty()) { int v = que.front(); que.pop(); for (int u : g[v]) { if (used[u] != -1) continue; used[u] = used[v] + 1; if (used[u] == 2) { if (u > i) st[i].insert(u); } else { que.push(u); } } } } ll ans = 0; for (int i = 0; i < n; i++) { for (int j = i + 1; j < n; j++) { for (int k = j + 1; k < n; k++) { if (st[i].find(j) == st[i].end() && st[i].find(k) == st[i].end() && st[j].find(k) == st[j].end()) ans++; } } } cout << ans << endl; return 0; }