#include <bits/stdc++.h>
using namespace std;
const long long maxn = 710;
long long n, m, a[maxn][maxn], b[maxn][maxn], c[maxn][maxn], du[maxn], ans;
int main() {
  scanf("%lld%lld", &n, &m);
  for (long long i = 1; i <= m; i++) {
    long long x, y;
    scanf("%lld%lld", &x, &y);
    du[x]++;
    du[y]++;
    a[x][y] = a[y][x] = 1;
  }
  for (long long k = 1; k <= n; k++)
    for (long long i = 1; i <= n; i++)
      for (long long j = 1; j <= n; j++) b[i][j] += a[i][k] * a[k][j];
  for (long long k = 1; k <= n; k++)
    for (long long i = 1; i <= n; i++)
      for (long long j = 1; j <= n; j++) c[i][j] += a[i][k] * b[k][j];
  for (long long i = 1; i <= n; i++)
    for (long long j = 1; j <= n; j++) ans += b[i][j] * c[i][j];
  ans /= 10;
  for (long long i = 1; i <= n; i++)
    for (long long j = i + 1; j <= n; j++)
      for (long long k = j + 1; k <= n; k++)
        if (a[i][j] && a[j][k] && a[i][k]) ans -= (du[i] + du[j] + du[k] - 3);
  printf("%lld\n", ans);
  return 0;
}
