import java.util.Scanner; class Main { static Scanner in = new Scanner(System.in); static boolean[][] r; public static void main(String[] args) { int N = in.nextInt(), M = in.nextInt(); r = new boolean[N][N]; for (int i = 0; i < M; i++) { int a = in.nextInt(), b = in.nextInt(); r[a][b] = r[b][a] = true; } int sum = 0; for (int a = 0; a < N - 3; a++) { for (int b = a + 1; b < N - 2; b++) { for (int c = b + 1; c < N - 1; c++) { for (int d = c + 1; d < N; d++) { sum += f(new int[] { a, b, c, d }); } } } } System.out.println(sum); } public static int f(int[] n) { boolean b = true; for(int i = 0; i < 4; i++){ int a = 0; for(int j = 0; j < 4; j++){ if(i == j) continue; if(r[n[i]][n[j]]) a++; } if(a != 2) b = false; } return b ? 1 : 0; } }