#include <iostream>
using namespace std;
typedef long long ll;
const ll INF = 3e2+5;
ll arr[INF][INF];
void power(ll n){
ll arr1[n][n];
for(int i = 0 ; i < n ; i++){
for(int j = 0 ; j < n; j++){
arr1[i][j]=0;
for(int k = 0 ; k < n ; k ++){
arr1[i][j]+=arr[i][k]* arr[k][j];
}
}
}
for(int i = 0 ; i < n ; i++){
for(int j = 0 ; j < n; j++){
arr[i][j]=arr1[i][j];
}
}
}
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
int n,m ;
cin>>n>>m;
ll a,b;
for(int i = 0 ; i < m ; i++){
cin>>a>>b;
a--;
b--;
if(a!=b){
arr[a][b]++;
arr[b][a]++;
}
}
power(n);
ll to_del[n];
for(int i = 0 ; i < n; i++){
to_del[i]=0;
for(int j = 0 ; j < n; j++){
if(i==j){
arr[i][i] = 0;
}else{
to_del[i]+=arr[i][j];
}
}
}
power(n);
ll answer =0;
for(int i = 0 ; i < n ; i++){
answer +=arr[i][i]-to_del[i];
}
cout<<answer/8;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwp0eXBlZGVmIGxvbmcgbG9uZyBsbDsKY29uc3QgbGwgSU5GID0gM2UyKzU7CmxsIGFycltJTkZdW0lORl07CnZvaWQgcG93ZXIobGwgbil7CglsbCBhcnIxW25dW25dOwoJZm9yKGludCBpICA9IDAgOyBpIDwgbiA7IGkrKyl7CgkJZm9yKGludCBqID0gMCA7IGogPCBuOyBqKyspewoJCQlhcnIxW2ldW2pdPTA7CgkJCWZvcihpbnQgayA9IDAgOyBrIDwgbiA7IGsgKyspewoJCQkJYXJyMVtpXVtqXSs9YXJyW2ldW2tdKiBhcnJba11bal07CgkJCX0KCQkJCgkJfQoJfQoJZm9yKGludCBpICA9IDAgOyBpIDwgbiA7IGkrKyl7CgkJZm9yKGludCBqID0gMCA7IGogPCBuOyBqKyspewoJCQlhcnJbaV1bal09YXJyMVtpXVtqXTsKCQl9Cgl9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