#include <bits/stdc++.h>
using namespace std;
const int maxn = 1111111;
int n, m;
pair<int, int> e[maxn * 3];
long long h[maxn], p[maxn];
long long ans;
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= m; ++i) {
    int u, v;
    scanf("%d%d", &u, &v);
    e[i] = make_pair(u, v);
    e[i + m] = make_pair(v, u);
  }
  m += m;
  p[0] = 1;
  for (int i = 1; i <= n; ++i) p[i] = p[i - 1] * 98124001;
  for (int r = 0; r < 2; ++r) {
    sort(e + 1, e + 1 + m);
    int l = 1;
    for (int i = 1; i <= n; ++i) {
      h[i] = 1;
      while (e[l].first == i) {
        h[i] = h[i] * p[e[l].second] + 239;
        ++l;
      }
    }
    sort(h + 1, h + 1 + n);
    int i = 1;
    while (i <= n) {
      int j = i;
      while (h[i] == h[j] && j <= n) ++j;
      ans += 1ll * (j - i) * (j - i - 1);
      i = j;
    }
    if (r == 0) {
      for (int i = 1; i <= n; ++i) e[++m] = make_pair(i, i);
    }
  }
  printf("%I64d", ans / 2);
  return 0;
}
