#include int v[102][102]; int main() { int n, m; scanf("%d %d", &n, &m); int a, b; int i, j, k; for (i = 0; i < n; i++) for (j = 0; j < n; j++) v[i][j] = 5; for (i = 0; i < n; i++) v[i][i] = 0; for (i = 0; i < m; i++) { scanf("%d %d", &a, &b); v[a - 1][b - 1] = 1; v[b - 1][a - 1] = 1; } for (i = 0; i < n; i++) { for (j = 0; j < n; j++) { if (v[i][j] < 2) continue; for (k = 0; k < n; k++) if (v[i][k] == 1 && v[k][j] == 1) v[i][j] = 2; } } int ans = 0; for (i = 0; i < n; i++) for (j = i + 1; j < n; j++) for (k = j + 1; k < n; k++) if (v[i][j] != 2 && v[j][k] != 2 && v[k][i] != 2) ans++; printf("%d\n", ans); return 0; }