#include <bits/stdc++.h>
using namespace std;
const int mm = 770;
long long dp[7][mm][mm];
bool vis[mm][mm];
int n, m;
int main() {
  while (cin >> n >> m) {
    memset(dp, 0, sizeof(dp));
    memset(vis, 0, sizeof(vis));
    int a, b;
    for (int i = 0; i < m; ++i) {
      cin >> a >> b;
      --a;
      --b;
      dp[0][a][b] = 1;
      dp[0][b][a] = 1;
    }
    for (int l = 0; l < 2; l++)
      for (int i = 0; i < n; i++)
        for (int j = 0; j < n; j++)
          if (dp[l][i][j])
            for (int k = 0; k < n; k++)
              if (dp[0][j][k]) dp[l + 1][i][k] += dp[l][i][j];
    long long ans = 0;
    for (int i = 0; i < n; i++) {
      for (int j = i + 1; j < n; j++) {
        for (int k = 0; k < n; k++) {
          if (dp[0][i][k] && dp[0][j][k] && dp[2][i][j]) {
            ans += dp[2][i][j] - dp[1][i][k] - dp[1][j][k];
            if (dp[0][i][j]) ans -= dp[1][i][i] + dp[1][j][j] - 3;
          }
        }
      }
    }
    cout << ans / 5 << endl;
  }
}
