#include <bits/stdc++.h>
using namespace std;
const int maxn = 2000010;
const int seed = 1331;
const int seed2 = 131;
unsigned int p[maxn], p2[maxn];
long long ans;
pair<unsigned int, unsigned int> h[maxn];
int main() {
  int N, M, u, v;
  scanf("%d%d", &N, &M);
  p[0] = 1;
  p2[0] = 1;
  for (int i = 1; i <= N; i++) p[i] = p[i - 1] * seed;
  for (int i = 1; i <= N; i++) p2[i] = p2[i - 1] * seed2;
  for (int i = 1; i <= N; i++) h[i].first = p[i], h[i].second = p2[i];
  for (int i = 1; i <= M; i++) {
    scanf("%d%d", &u, &v);
    h[u].first += p[v];
    h[v].first += p[u];
    h[u + N].first += p[v];
    h[v + N].first += p[u];
    h[u].second += p2[v];
    h[v].second += p2[u];
    h[u + N].second += p2[v];
    h[v + N].second += p2[u];
  }
  sort(h + 1, h + N + N + 1);
  for (int i = 1; i <= N + N; i++) {
    int j = i;
    while (j + 1 <= N + N && h[j + 1] == h[i]) j++;
    ans += (long long)(j - i + 1) * (j - i) / 2;
    i = j;
  }
  printf("%I64d\n", ans);
  return 0;
}
