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

int n,m,x[100010],y[100010],gg[405],ans;
bitset <405> a[405];

void work()
{
	scanf("%d %d",&n,&m);
	for (int i=1; i<=m; i++)  scanf("%d %d",&x[i],&y[i]);
	for (int i=1; i<=n; i++)
		{
			a[i][i]=1;
			for (int j=m; j; j--)
				if ((a[i][x[j]])&&(a[i][y[j]]))  gg[i]=1;
				else  if ((a[i][x[j]])||(a[i][y[j]]))  a[i][x[j]]=1,a[i][y[j]]=1;
		}
	for (int i=1; i<=n; i++)
		for (int j=1; j<i; j++)
			ans+=(!gg[i])&&(!gg[j])&&(!(a[i]&a[j]).count());
	printf("%d",ans);
}

int main()
{
	work();
	return 0;
}
