#include using namespace std; #define rep(i,n) for (int i=0;i<(n);i++) #define rep2(i,a,b) for (int i=(a);i<(b);i++) #define rrep(i,n) for (int i=(n)-1;i>=0;i--) #define rrep2(i,a,b) for (int i=(b)-1;i>=(a);i--) #define all(a) (a).begin(),(a).end() typedef long long ll; typedef pair P; int N, M; bool mat[50][50]; bool ps_have(int a, int b) { return mat[a][b]; } bool loop(int i, int j, int k, int l) { return ps_have(i, j) && ps_have(j, k) && ps_have(k, l) && ps_have(l, i); } bool square(int i, int j, int k, int l) { return loop(i, j, k, l) && !ps_have(i, k) && !ps_have(j, l); } void solve() { int cnt = 0; cin >> N >> M; rep(i, M) { int a, b; cin >> a >> b; mat[a][b] = mat[b][a] = true; } rep(i, N) { rep2(j, i + 1, N) { rep2(k, j + 1, N) { rep2(l, k + 1, N) { if (square(i, j, k, l) || square(i, j, l, k) || square(i, k, j, l) ) { cnt ++; } } } } } cout << cnt << endl; } int main() { solve(); return 0; }