#include <cstdio>
using namespace std;

bool u[400][400];
bool die[400];
int x[100005], y[100005];
int n,m;

int main()
{
  scanf("%d%d", &n, &m);  
  for (int i = 0; i < m;i++) {
    scanf("%d%d", x+i, y+i);
  }

  for (int i = 0; i < n;i++) u[i][i] = true;

  for (int i = m-1; i>=0; i--) {
    int p = x[i] - 1, q = y[i] - 1;
    for (int j = 0; j < n; j++) {
      die[j] |= (u[p][j] && u[q][j]);
      u[p][j] = u[q][j] = (u[p][j] || u[q][j]);
    }
  }

  int ans = 0;
  for (int i = 0; i < n; i++)
  for (int j = i+1; j < n; j++) if (!die[i] && !die[j]) {
    ans++;
    for (int k = 0; k < n; k++) if (u[k][i] && u[k][j]) {
      ans--;
      break;
    }
  }
  printf("%d\n", ans);
  return 0;
}