#include<cmath>
#include<bitset>
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;
const int MAXN = 100005;
bitset <405> a[405];
int n, m, i, j, k, ans;
int x[MAXN], y[MAXN], gg[MAXN];
int main()
{
	cin >> n >> m;
	for(i = 1; i <= m; i ++)
		scanf("%d%d", &x[i], &y[i]);
	for(i = 1; i <= n; i ++)
	{
		a[i][i] = 1;
		for(j = m; j >= 1; j --)
			if (a[i][x[j]] && a[i][y[j]]){gg[i] = 1; break;}
			else if (a[i][x[j]]) a[i][y[j]] = 1;
			else if (a[i][y[j]]) a[i][x[j]] = 1;
	}
	for(i = 1; i <= n; i ++)
		if (!gg[i])
			for(j = 1 + i; j <= n; j ++)
				if (!gg[j])
					if ((a[i] & a[j]).count() == 0)
						ans ++;
	cout << ans << endl;
}