#include <bits/stdc++.h>
using namespace std;
int a[777][777], b[777][777], c[777][777];
long long ans;
int n, m;
int d[777];
int main() {
  cin >> n >> m;
  int t1, t2;
  for (int i = 1; i <= m; i++) {
    scanf("%d %d", &t1, &t2);
    a[t1][t2]++;
    a[t2][t1]++;
    d[t1]++;
    d[t2]++;
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      for (int k = 1; k <= n; k++) {
        b[i][j] += a[i][k] * a[k][j];
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      for (int k = 1; k <= n; k++) {
        c[i][j] += a[i][k] * b[k][j];
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      ans += b[i][j] * c[i][j];
    }
  }
  ans /= 10;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= i; j++) {
      if (!a[i][j]) continue;
      for (int k = 1; k <= j; k++) {
        if ((!a[i][k]) || (!a[k][j])) continue;
        ans -= d[i] + d[k] + d[j] - 3;
      }
    }
  }
  cout << ans;
  return 0;
}
