#include <bits/stdc++.h>
using namespace std;
int N;
bool graph[710][710];
long long a[710][710], b[710][710];
int main(void) {
  int M, i, j, k, u, v;
  scanf("%d%d", &N, &M);
  for ((i) = 0; (i) < (int)(M); (i)++) {
    scanf("%d%d", &u, &v);
    u--;
    v--;
    graph[u][v] = graph[v][u] = true;
  }
  for ((k) = 0; (k) < (int)(N); (k)++)
    for ((j) = 0; (j) < (int)(N); (j)++)
      if (graph[j][k])
        for ((i) = 0; (i) < (int)(j); (i)++)
          if (graph[i][j]) a[i][k]++;
  for ((i) = 0; (i) < (int)(N); (i)++)
    for ((j) = 0; (j) < (int)(N); (j)++)
      b[i][j + 1] = b[i][j] + (graph[i][j] ? 1 : 0);
  long long ans = 0;
  for ((k) = 0; (k) < (int)(N); (k)++)
    for ((j) = 0; (j) < (int)(k); (j)++)
      if (graph[j][k])
        for ((i) = 0; (i) < (int)(j); (i)++) {
          long long x = a[i][j];
          if (graph[i][k]) x--;
          long long y = a[i][k];
          if (graph[i][j]) y--;
          ans += x * y;
        }
  for ((k) = 0; (k) < (int)(N); (k)++)
    for ((j) = 0; (j) < (int)(k); (j)++)
      if (graph[j][k])
        for ((i) = 0; (i) < (int)(j); (i)++)
          if (graph[i][k] && graph[i][j]) ans -= b[i][i] + b[j][i] + b[k][i];
  cout << ans << endl;
  return 0;
}
