#include<cstdio>
#include<iostream>
using namespace std;
struct tur{
	int x,y;
}q[100001];
int c[501][401],n,m,ans,a[401][401];
inline bool check(int x,int y){
	if (a[x][y]) return false;
	if (a[x][0]||a[y][0]) return false;
	for (int i=1; i<=n; i++)
		if (c[x][i]&&c[y][i]) return false;
	return true;
}
int main(){
	scanf("%d%d",&n,&m);
	for (int i=1; i<=m; i++)
		scanf("%d%d",&q[i].x,&q[i].y),
		a[q[i].x][q[i].y]=a[q[i].y][q[i].x]=1;
	for (int i=1; i<=n; i++){
		c[i][i]=1;
		for (int j=m; j>=1; j--){
			if (c[i][q[j].x]&&c[i][q[j].y]){a[i][0]=1; break;}
			if (c[i][q[j].x]) c[i][q[j].y]=1;
			else if (c[i][q[j].y]) c[i][q[j].x]=1;
		}
	}
	for (int i=1; i<=n; i++)
		for (int j=1+i; j<=n; j++)
			if (check(i,j)) ans++;
	printf("%d\n",ans);
	return 0;
}
