#include<bits/stdc++.h> 
#define fo(i,a,b) for(i=a;i<=b;i++)
#define fd(i,a,b) for(i=a;i>=b;i--)
#define min(a,b) (a<b?a:b)
#define max(a,b) (a>b?a:b)
typedef long long ll;
using namespace std;
inline int read(){
	int n=0,f=1;char c;
	for(c=getchar();(c<'0'||c>'9')&&c!='-';c=getchar());
	if (c=='-') c=getchar(),f=-1;
	for(;c>='0'&&c<='9';c=getchar()) n=n*10+c-48;
	return n*f;
}
const int maxn=405,mn=1e5+5;
bitset<maxn>s[maxn];
int i,j,n,m,t,x[mn],y[mn],ans;
int main(){
	n=read(),m=read();
	fo(i,1,m) x[i]=read(),y[i]=read();
	fo(i,1,n){
		s[i][i]=1;
		for(t=m;t;t--){
			if (s[i][x[t]]&&s[i][y[t]]) break;
			if (!s[i][x[t]]&&!s[i][y[t]]) continue;
			s[i][x[t]]=s[i][y[t]]=1;
		}
		s[i][0]=t>0;
	}
	fo(i,1,n-1)
	fo(j,i+1,n) if (!s[i][0]&&!s[j][0]) ans+=!((s[i]&s[j]).any());
	printf("%d\n",ans);
}