#include <bits/stdc++.h>
const int N = 705;
using namespace std;
bitset<N> ar[N];
long long sz[N], n, m, ans, dp[N][N];
int main() {
  ios_base::sync_with_stdio(0);
  cout.tie(0);
  cin.tie(0);
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    int u, v;
    cin >> u >> v;
    ar[u][v] = 1;
    ar[v][u] = 1;
    sz[u]++;
    sz[v]++;
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) dp[i][j] = (ar[i] & ar[j]).count();
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      for (int k = 1; k <= n; k++) {
        if (i == j || i == k || j == k) continue;
        if (!ar[j][k]) continue;
        ans += (dp[i][k] - ar[i][j]) * (dp[i][j] - ar[i][k]);
        if (ar[i][k] && ar[i][j]) {
          ans -= sz[i] - 2;
        }
      }
    }
  }
  cout << ans / 10 << endl;
  return 0;
}
