#include <iostream>
#define MAX 301
using namespace std;
int x[MAX][MAX];
int y[MAX][MAX];
int main() {
int n,m,i,j,e,u,v,q,z,r=0;
scanf("%d%d",&n,&m);
for (i=0; i<m; i++) {
scanf("%d%d",&u,&v);
x[u-1][v-1]=1; x[v-1][u-1]=1;
}
for (i=0; i<n-1; i++) {
for (j=i+1; j<n; j++) {
q=0;
for (e=0; e<n; e++) {
if (x[i][e]==1 && x[j][e]==1) q++;
}
y[i][j]=q;
}
}
for (e=0; e<n; e++) {
for (i=e+1; i<n; i++) {
if (x[e][i]==1) {
for (j=i+1; j<n; j++) {
if (x[e][j]==1) {
z=y[i][j];
if (z>1) {
z--;
r+=z;
y[i][j]=z;
}
}
}
}
}
}
/*for (i=0; i<n; i++) {
for (j=0; j<n; j++) {
cout << x[i][j] << " ";
}
cout << "\n";
}
for (i=0; i<n; i++) {
for (j=0; j<n; j++) {
cout << y[i][j] << " ";
}
cout << "\n";
}*/
printf("%d",r);
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojZGVmaW5lIE1BWCAzMDEKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCmludCB4W01BWF1bTUFYXTsKaW50IHlbTUFYXVtNQVhdOwppbnQgbWFpbigpIHsKCWludCBuLG0saSxqLGUsdSx2LHEseixyPTA7CglzY2FuZigiJWQlZCIsJm4sJm0pOwoJZm9yIChpPTA7IGk8bTsgaSsrKSB7CgkJc2NhbmYoIiVkJWQiLCZ1LCZ2KTsKCQl4W3UtMV1bdi0xXT0xOyB4W3YtMV1bdS0xXT0xOwoJfQoJZm9yIChpPTA7IGk8bi0xOyBpKyspIHsKCQlmb3IgKGo9aSsxOyBqPG47IGorKykgewoJCQlxPTA7CgkJCWZvciAoZT0wOyBlPG47IGUrKykgewoJCQkJaWYgKHhbaV1bZV09PTEgJiYgeFtqXVtlXT09MSkgcSsrOwoJCQl9CgkJCXlbaV1bal09cTsKCQl9Cgl9Cglmb3IgKGU9MDsgZTxuOyBlKyspIHsKCQl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