#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x;
}
long long dp[3][710][710];
long long ans;
int n, m;
int main() {
  n = read();
  m = read();
  for (int i = 1; i <= m; i++) {
    int x, y;
    x = read();
    y = read();
    dp[0][x][y] = dp[0][y][x] = 1;
  }
  for (int p = 0; p < 2; p++) {
    for (int i = 1; i <= n; i++) {
      for (int j = 1; j <= n; j++) {
        if (!dp[p][i][j]) continue;
        for (int k = 1; k <= n; k++) {
          if (!dp[0][j][k]) continue;
          dp[p + 1][i][k] += dp[p][i][j];
        }
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = i + 1; j <= n; j++) {
      for (int k = 1; 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;
  return 0;
}
