#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;

const int N = 4e2 + 8;
int n, m, ans;
bool dead[N];
bool tar[N][N];

int main() {
	ios::sync_with_stdio(false), cin.tie(0);
	cin >> n >> m;
	for (int i = 0; i < m; i++) {
		int a, b;
		cin >> a >> b;
		a--, b--;

		if (dead[a] || dead[b] || tar[a][b]) {
			dead[a] = dead[b] = true;
			continue;
		}
		
		tar[a][b] = tar[b][a] = true;
		for (int c = 0; c < n; c++)
			if (c != a && tar[c][b])
				tar[a][c] = tar[c][a] = true;
		for (int c = 0; c < n; c++)
			if (c != b && tar[c][a])
				tar[b][c] = tar[c][b] = true;
	}

	for (int i = 0; i < n; i++)
		for (int j = i + 1; j < n; j++)
			ans += !dead[i] && !dead[j] && !tar[i][j];

	cout << ans << "\n";
	return 0;
}