#int(input()) #map(int, input().split()) #list(map(int, input().split())) N, M = map(int, input().split()) to = [set() for i in range(N)] for i in range(M): a, b = map(int, input().split()) to[a-1].add(b-1) to[b-1].add(a-1) ans = 0 good = [set() for i in range(N)] for i in range(N-1): for j in range(i+1, N): if j in to[i]: good[i].add(j) good[j].add(i) continue f = 1 for k in range(N): if (k-i)*(k-j) == 0: continue if k in to[i] and k in to[j]: f = 0 break if f == 1: good[i].add(j) good[j].add(i) ans = 0 # print(good) for i in range(N-2): for j in range(i+1, N-1): for k in range(j+1, N): if i in good[j] and j in good[k] and k in good[i]: ans += 1 # print(i, j, k) print(ans)