#include <bits/stdc++.h>
using namespace std;
const int MAXN = 7e2 + 11;
int n, m, a[MAXN][MAXN], b[MAXN][MAXN], c[MAXN][MAXN], d[MAXN];
long long ans;
int main(void) {
  scanf("%d%d", &n, &m);
  for (int i = 1, u, v; i <= m; ++i) {
    scanf("%d%d", &u, &v);
    ++a[u][v], ++a[v][u];
    ++d[u], ++d[v];
  }
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= n; ++j)
      for (int k = 1; k <= n; ++k) b[i][j] += a[i][k] * a[k][j];
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= n; ++j)
      for (int k = 1; k <= n; ++k) c[i][j] += b[i][k] * a[k][j];
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= n; ++j) ans += 1LL * b[i][j] * c[i][j];
  ans /= 10;
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= i; ++j)
      if (a[i][j])
        for (int k = 1; k <= j; ++k)
          if (a[i][k] && a[j][k]) ans -= d[i] + d[j] + d[k] - 3;
  printf("%lld", ans);
  return 0;
}
