#include <bits/stdc++.h>
int n, m, x[100010], y[100010], book[510], now, ans;
int Must[510][510];
bool kill(int u) {
  Must[u][u] = 1;
  for (register int i = (m); i >= (1); i = ~(-i)) {
    if (Must[u][x[i]] && Must[u][y[i]]) return 0;
    if (Must[u][x[i]] || Must[u][y[i]]) Must[u][x[i]] = Must[u][y[i]] = 1;
  }
  return 1;
}
int main() {
  scanf("%d%d", &n, &m);
  for (register int i = (1); i <= (m); i = -(~i)) scanf("%d%d", &x[i], &y[i]);
  for (register int i = (1); i <= (n); i = -(~i)) book[i] = kill(i);
  for (register int i = (1); i <= (n); i = -(~i))
    if (book[i])
      for (register int j = (i + 1); j <= (n); j = -(~j))
        if (book[j]) {
          now = 1;
          for (register int k = (1); k <= (n); k = -(~k))
            if (Must[i][k] && Must[j][k]) {
              now = 0;
              break;
            }
          ans += now;
        }
  return printf("%d\n", ans), 0;
}
