#include<cstdio>
#include<algorithm>
#include<cstring>
#include<bitset>
using namespace std;
const int M=100005;
bitset<405> bt[405];
int n,m,ans,x[M],y[M],die[405];
int read()
{
   int x=0,f=1;char ch=getchar();
   while (ch<'0'||ch>'9') {if (ch=='-') f=-1;ch=getchar();}
   while (ch>='0'&&ch<='9') x=(x<<1)+(x<<3)+ch-'0',ch=getchar();
   return x*f;
}
int main()
{
	n=read();m=read();
	for (int i=1;i<=m;i++) x[i]=read(),y[i]=read();
	for (int i=1;i<=n;i++)
	{
		bt[i][i]=1;
		for (int j=m;j>=1;j--)
		{
			if (bt[i][x[j]]&&bt[i][y[j]]) die[i]=1;
			if (bt[i][x[j]]||bt[i][y[j]]) bt[i][x[j]]=bt[i][y[j]]=1;
		}
	}
	for (int i=1;i<n;i++)
	  if (!die[i])
	  for (int j=i+1;j<=n;j++)
	    if (!die[j]&&(bt[i]&bt[j]).none()) ans++;
	printf("%d\n",ans);
   return 0;
}
