#include <bits/stdc++.h>
using namespace std;
long long hash1[2000000];
long long h[2000000];
long long h1[2000000];
int n;
void init() {
  hash1[0] = 1;
  for (int i = 1; i <= n; i++) {
    hash1[i] = hash1[i - 1] * 7;
  }
}
int main() {
  int m;
  scanf("%d%d", &n, &m);
  init();
  for (int i = 0; i < m; i++) {
    int a, b;
    scanf("%d%d", &a, &b);
    h[a] += hash1[b];
    h[b] += hash1[a];
  }
  for (int i = 1; i <= n; i++) {
    h1[i] = h[i] + hash1[i];
  }
  sort(h + 1, h + n + 1);
  sort(h1 + 1, h1 + n + 1);
  long long int pre = h[1];
  long long int sum = 0;
  long long int cnt = 1;
  for (int i = 2; i <= n; i++) {
    if (h[i] == pre) {
      cnt++;
    } else {
      sum += cnt * (cnt - 1) / 2;
      pre = h[i];
      cnt = 1;
    }
  }
  sum += cnt * (cnt - 1) / 2;
  pre = h1[1];
  cnt = 1;
  for (int i = 2; i <= n; i++) {
    if (h1[i] == pre) {
      cnt++;
    } else {
      sum += cnt * (cnt - 1) / 2;
      pre = h1[i];
      cnt = 1;
    }
  }
  sum += cnt * (cnt - 1) / 2;
  printf("%lld\n", sum);
}
