import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int m = sc.nextInt(); int[][] costs = new int[n][n]; for (int i = 0; i < n; i++) { Arrays.fill(costs[i], Integer.MAX_VALUE / 10); costs[i][i] = 0; } for (int i = 0; i < m; i++) { int a = sc.nextInt() - 1; int b = sc.nextInt() - 1; costs[a][b] = 1; costs[b][a] = 1; } for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { for (int k = 0; k < n; k++) { costs[j][k] = Math.min(costs[j][k], costs[j][i] + costs[i][k]); } } } int count = 0; for (int i = 0; i < n - 2; i++) { for (int j = i + 1; j < n - 1; j++) { for (int k = j + 1; k < n; k++) { if (costs[i][j] != 2 && costs[j][k] != 2 && costs[i][k] != 2) { count++; } } } } System.out.println(count); } }