#include <bits/stdc++.h>
using namespace std;
long long ans;
vector<unsigned> e[1000001];
unsigned i, j, n, m, a[1000000], b[1000000];
unsigned long long t, c[1000001];
int main() {
  scanf("%d%d", &n, &m);
  for (i = 0; i < m; ++i) {
    scanf("%d%d", a + i, b + i);
    --a[i];
    --b[i];
    e[a[i]].push_back(b[i]);
    e[b[i]].push_back(a[i]);
  }
  c[n] = ~0;
  for (i = 0; i < n; ++i) {
    e[i].push_back(i);
    sort(e[i].begin(), e[i].end());
    for (t = j = 0; j < e[i].size(); ++j) t = t * 23456789 + e[i][j] + 1;
    c[i] = t;
  }
  sort(c, c + n);
  for (i = 0; i < n; i = j) {
    for (j = i + 1; c[i] == c[j]; ++j)
      ;
    ans += (long long)(j - i) * (j - i - 1);
  }
  for (i = 0; i < n; ++i) e[i].clear();
  for (i = 0; i < m; ++i) {
    e[a[i]].push_back(b[i]);
    e[b[i]].push_back(a[i]);
  }
  for (i = 0; i < n; ++i) {
    sort(e[i].begin(), e[i].end());
    for (t = j = 0; j < e[i].size(); ++j) t = t * 23456789 + e[i][j] + 1;
    c[i] = t;
  }
  sort(c, c + n);
  for (i = 0; i < n; i = j) {
    for (j = i + 1; c[i] == c[j]; ++j)
      ;
    ans += (long long)(j - i) * (j - i - 1);
  }
  printf("%I64d\n", ans >> 1);
  return 0;
}
