n, m = map(int, input().split()) isfriend = [[False] * n for i in range(n)] for i in range(m): a, b = map(int, input().split()) isfriend[a-1][b-1] = True isfriend[b-1][a-1] = True isgood = [[True] * n for i in range(n)] for k in range(n): for i in range(n): for j in range(n): if i == j: continue if isfriend[i][j]: continue if isfriend[i][k] and isfriend[k][j]: isgood[i][j] = False ans = 0 for i in range(n): for j in range(i+1, n): for k in range(j+1, n): if isgood[i][j] and isgood[j][k] and isgood[i][k]: ans += 1 print(ans)