#include<cstdio>
#include<cstring>
#include<algorithm>
#define rep(i,a,b) for(int i=(a);i<=(b);i++)
#define per(i,a,b) for(int i=(a);i>=(b);i--)
using namespace std;
const int N=405;
const int M=100005;
int vis[405][405];
pair<int,int> xjt[M];
int gg[N];
int main()
{
	int n,m;scanf("%d%d",&n,&m);
	rep(i,1,m)scanf("%d%d",&xjt[i].first,&xjt[i].second);
	rep(i,1,n)
	{
		vis[i][i]=1;gg[i]=0;
		per(j,m,1)
		{
			if(vis[i][xjt[j].first] && vis[i][xjt[j].second]){gg[i]=1;break;}
			if(vis[i][xjt[j].first]) vis[i][xjt[j].second]=1;
			else if(vis[i][xjt[j].second]) vis[i][xjt[j].first]=1;
		}
	}
	int ans=0;
	rep(i,1,n)if(!gg[i])rep(j,i+1,n)if(!gg[j])
	{
		int fg=1;
		rep(k,1,n)if(vis[i][k] && vis[j][k]) {fg=0;break;}ans+=fg;
	}
	printf("%d\n",ans);
	return 0;
}