#include <cstdio>
int n, m, a[100009], b[100009]; bool r[409][409], f[409];
int main() {
	scanf("%d %d", &n, &m);
	for (int i = m - 1; i >= 0; i--) scanf("%d %d", &a[i], &b[i]), a[i]--, b[i]--;
	for (int i = 0; i < n; i++) {
		r[i][i] = true;
		for (int j = 0; j < m; j++) {
			if (r[i][a[j]] && r[i][b[j]]) f[i] = true;
			if (r[i][a[j]]) r[i][b[j]] = true;
			if (r[i][b[j]]) r[i][a[j]] = true;
		}
	}
	int ret = 0;
	for (int i = 0; i < n; i++) {
		for (int j = i + 1; j < n; j++) {
			bool ok = true;
			for (int k = 0; k < n; k++) {
				if (r[i][k] && r[j][k]) ok = false;
			}
			if (ok && !f[i] && !f[j]) ret++;
		}
	}
	printf("%d\n", ret);
	return 0;
}