#include<bits/stdc++.h>
using namespace std;
typedef long long LL;

struct cww{cww(){
    ios::sync_with_stdio(false);cin.tie(0);
}}star;
#define fin "\n"
#define FOR(i,bg,ed) for(int i=(bg);i<(ed);i++)
#define REP(i,n) FOR(i,0,n)
#define fi first
#define se second
#define pb push_back
#define DEBUG if(0)
template <typename T>inline void chmin(T &l,T r){l=min(l,r);}
template <typename T>inline void chmax(T &l,T r){l=max(l,r);}
template <typename T>
istream& operator>>(istream &is,vector<T> &v){
    for(auto &it:v)is>>it;
    return is;
}

typedef vector<int> V;
typedef vector<V> VV;

int main(){
    int N,M;
    cin>>N>>M;
    VV g(N,V(N,0));
    REP(i,M){
        int a,b;
        cin>>a>>b;
        g[a][b]=g[b][a]=1;
    }
    int res=0;
    REP(a,N)FOR(b,a+1,N)FOR(c,b+1,N)FOR(d,c+1,N){
        vector<int> v={a,b,c,d};
        vector<int> u={1,2,3};
        int ok=0;
        do{
            ok|=(g[v[0]][v[u[0]]])
                &(g[v[u[0]]][v[u[1]]])
                &(g[v[u[1]]][v[u[2]]])
                &(g[v[0]][v[u[2]]])
                &(!g[v[u[0]]][v[u[2]]])
                &(!g[v[0]][v[u[1]]]);
        }while(next_permutation(u.begin(),u.end()));
        res+=ok;
    }
    cout<<res<<endl;
    return 0;
}