#include <bits/stdc++.h>
using namespace std;
const int N = 707;
int n, m, T[N];
long long tot;
bitset<N> Adj[N], CM[N][N];
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= m; i++) {
    int v, u;
    scanf("%d%d", &v, &u), Adj[v][u] = Adj[u][v] = 1;
  }
  for (int i = 1; i <= n; i++)
    for (int j = i + 1; j <= n; j++) CM[i][j] = Adj[i] & Adj[j];
  for (int i = 1; i <= n; i++) {
    for (int j = i + 1; j <= n; j++) T[j] = (CM[i][j] >> i).count();
    for (int j = i + 1; j <= n; j++)
      for (int h = j + 1; h <= n; h++)
        if (Adj[j][h]) tot += (T[j] - Adj[i][h]) * (T[h] - Adj[i][j]);
  }
  for (int i = 1; i <= n; i++) {
    int cnt = 0;
    for (int j = i + 1; j <= n; j++)
      if (Adj[i][j]) cnt += (CM[i][j] >> j).count();
    for (int j = i - 1; j; j--)
      if (Adj[i][j]) tot -= cnt, cnt += (CM[j][i] >> j).count();
  }
  return !printf("%lld", tot);
}
