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(); ArrayList> graph = new ArrayList<>(); ArrayList> exist = new ArrayList<>(); for (int i = 0; i < n; i++) { graph.add(new ArrayList<>()); exist.add(new HashSet<>()); } for (int i = 0; i < m; i++) { int a = sc.nextInt(); int b = sc.nextInt(); graph.get(a).add(b); graph.get(b).add(a); exist.get(a).add(b); exist.get(b).add(a); } int ans = 0; for (int i = 0; i < n - 1; i++) { for (int j = i + 1; j < n; j++) { if (exist.get(i).contains(j)) { continue; } for (int a = 0; a < graph.get(i).size() - 1; a++) { for (int b = a + 1; b < graph.get(i).size(); b++) { if (exist.get(j).contains(graph.get(i).get(a)) && exist.get(j).contains(graph.get(i).get(b)) && !exist.get(graph.get(i).get(a)).contains(graph.get(i).get(b))) { ans++; } } } } } System.out.println(ans / 2); } }