#include <bits/stdc++.h>
using namespace std;
const long double eps = 1e-9;
const int inf = (1 << 30) - 1;
const long long inf64 = ((long long)1 << 62) - 1;
const long double pi = 3.1415926535897932384626433832795;
template <class T>
T sqr(T x) {
  return x * x;
}
const int nmax = 700;
int n, m;
bitset<nmax> g[nmax];
bitset<nmax> w[nmax][nmax];
bitset<nmax> a, b, c;
int f[nmax][nmax];
long long res;
long long s[nmax];
int main() {
  cin >> n >> m;
  for (int i = 0; i < (int)(m); i++) {
    int u, v;
    scanf("%d %d", &v, &u);
    v--;
    u--;
    g[u][v] = g[v][u] = 1;
    s[v]++;
    s[u]++;
  }
  for (int i = 0; i < (int)(n); i++)
    for (int j = 0; j < (int)(n); j++) {
      w[i][j] = g[i] & g[j];
      w[i][j][i] = w[i][j][j] = 0;
      f[i][j] = w[i][j].count();
    }
  long long q = 0;
  for (int i = 0; i < (int)(n); i++)
    for (int j = 0; j < (int)(n); j++)
      if (g[i][j]) q = q + (s[i] - 2) * f[i][j];
  q /= 2;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++)
      if (g[i][j])
        for (int k = 0; k < n; k++)
          if (j != k && i != k)
            res = res + (f[i][k] - w[i][k][j]) * (f[j][k] - w[j][k][i]);
  }
  res = (res - 2 * q) / 10;
  cout << res << endl;
  return 0;
  n = 700;
  m = n * (n - 1) / 2;
  cout << n << " " << m << endl;
  for (int i = 0; i < (int)(n); i++)
    for (int j = 0; j < (int)(n); j++)
      if (j > i) printf("%d %d\n", i + 1, j + 1);
  return 0;
}
