#include <bits/stdc++.h>
using namespace std;
int t[777][777];
int f[777][777];
int n, a[777][777], m;
int main() {
  scanf("%d%d", &n, &m);
  for (int(i) = 0; (i) < (m); ++(i)) {
    int p, q;
    scanf("%d%d", &p, &q);
    --p;
    --q;
    a[p][q] = a[q][p] = 1;
  }
  for (int(i) = 0; (i) < (n); ++(i))
    for (int(j) = 0; (j) < (n); ++(j))
      if (i != j)
        for (int(k) = 0; (k) < (n); ++(k))
          if (a[i][k] && a[j][k]) t[i][j]++;
  for (int(i) = 0; (i) < (n); ++(i))
    for (int(k) = 0; (k) < (n); ++(k))
      if (a[i][k])
        for (int(j) = 0; (j) < (n); ++(j))
          if (i != j && j != k) {
            f[i][j] += t[k][j];
            if (a[i][j]) f[i][j]--;
          }
  long long ans = 0;
  for (int(i) = 0; (i) < (n); ++(i))
    for (int(j) = 0; (j) < (n); ++(j))
      if (a[i][j])
        for (int(k) = 0; (k) < (n); ++(k))
          if (a[i][k] && k != j) {
            ans += f[j][k] - t[i][j] - t[i][k];
            if (a[j][k]) ans += 2;
          }
  cout << ans / (long long)10 << endl;
}
