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