#include <bits/stdc++.h>
using namespace std;
struct Matrix {
  long long int a[705][705];
};
int n, m, x, y, G[705][705];
Matrix W, A, R, T;
long long int t, tri[705], deg[705], con[705][705], ret;
void Mul(Matrix &T, Matrix &A, int flag) {
  for (int i = (0); i < (n); i++)
    for (int j = (i); j < (n); j++) {
      if (flag && i != j) continue;
      R.a[i][j] = 0;
      for (int k = (0); k < (n); k++)
        if (T.a[i][k] && A.a[k][j]) R.a[i][j] += T.a[i][k] * A.a[k][j];
      R.a[j][i] = R.a[i][j];
    }
}
int main() {
  scanf("%d%d", &n, &m);
  while (m--) {
    scanf("%d%d", &x, &y), x--, y--;
    G[x][y] = G[y][x] = 1;
    A.a[x][y] = A.a[y][x] = 1;
    deg[x]++, deg[y]++;
  }
  Mul(A, A, 0), T = R;
  for (int i = (0); i < (n); i++)
    for (int j = (0); j < (n); j++) con[i][j] = T.a[i][j];
  Mul(T, A, 0), W = R;
  for (int i = (0); i < (n); i++) tri[i] = W.a[i][i] >> 1;
  Mul(T, W, 1), W = R;
  for (int i = (0); i < (n); i++) ret += W.a[i][i];
  for (int i = (0); i < (n); i++) {
    ret -= tri[i] * (10 + (deg[i] - 2) * 4);
    for (int j = (0); j < (n); j++) {
      if (!G[i][j]) continue;
      for (int k = (0); k < (n); k++) {
        if (!G[j][k] || i == k) continue;
        t = con[j][k];
        if (G[i][k]) t--;
        ret -= t;
        if (!G[i][k]) continue;
        ret -= (deg[k] - 2) * 2;
      }
    }
  }
  printf("%I64d\n", ret / 10);
  return 0;
}
