#include <bits/stdc++.h>
using namespace std;

const int MAXN = 405, MAXM = 100005;

int n, m, u[MAXM], v[MAXM];
bitset<MAXN> vis[MAXN];
bool alive[MAXN];

inline int read()
{
	int a = 0, c;
	do c = getchar(); while (!isdigit(c));
	while (isdigit(c)) {
		a = a*10+c-'0';
		c = getchar();
	}
	return a;
}

int main()
{
	n = read(), m = read();
	for (int i = 1; i <= m; i++) u[i] = read(), v[i] = read();
	for (int i = 1; i <= n; i++) {
		vis[i][i] = 1;
		alive[i] = 1;
		for (int j = m; j >= 1; j--) {
			if (vis[i][u[j]] && vis[i][v[j]]) { alive[i] = 0; break; }
			else if (vis[i][u[j]]) vis[i][v[j]] = 1;
			else if (vis[i][v[j]]) vis[i][u[j]] = 1;
		}
	}
	int cnt = 0;
	for (int i = 1; i <= n; i++)
		for (int j = i+1; j <= n; j++)
			if (alive[i] && alive[j] && (vis[i]&vis[j]).none())
				cnt++;
	cout << cnt << endl;
	return 0;
}
