import std.algorithm;
import std.conv;
import std.stdio;

void main ()
{
	int n, m;
	while (readf (" %s %s", &n, &m) > 0)
	{
		auto a = new bool [] [] (n, n);
		auto b = new bool [] [] (n, n);
		foreach (i; 0..n)
		{
			b[i][i] = true;
		}
		auto d = new bool [n];
		foreach (j; 0..m)
		{
			int u, v;
			readf (" %s %s", &u, &v);
			u -= 1;
			v -= 1;
			if (a[u][v] || a[v][u] || d[u] || d[v])
			{
				d[u] = d[v] = true;
			}
			a[u][v] = true;
			a[v][u] = true;
			foreach (i; 0..n)
			{
				if (b[i][u] || b[i][v])
				{
					b[i][u] = b[i][v] = true;
				}
			}
		}

		int res = 0;
		foreach (i; 0..n) if (!d[i])
		{
			foreach (j; i + 1..n) if (!d[j])
			{
				res += !b[i][j] && !b[j][i];
			}
		}
		writeln (res);
	}
}
