#include <cstdio>
#include <cstring>
#include <algorithm>
#include <bitset>
using namespace std;
const int maxn = 405, maxm = 100005;
int N, M, a[maxm], b[maxm];
bitset<maxn> s[maxn];
int main() {
	scanf("%d %d", &N, &M);
	for(int i = 1; i <= M; ++i) 
		scanf("%d %d", a + i, b + i);
	for(int i = 1; i <= N; ++i) {
		bitset<maxn> &S = s[i];
		S[i] = 1;
		for(int j = M; j; --j) {
			if(S[a[j]] && S[b[j]]) {
				S[0] = 1; break;
			} 
			if(S[a[j]]) S[b[j]] = 1;
			if(S[b[j]]) S[a[j]] = 1;
		}
	}
	int ans = 0;
	for(int i = 1; i <= N; ++i) if(!s[i][0]) {
		for(int j = 1; j < i; ++j) if(!s[j][0]) {
			ans += not (s[i] & s[j]).any();
		}
	}
	printf("%d\n", ans);
	return 0;
}