#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 3;
long long ph[N], ph2[N], pow2[N];
int main() {
  int n, m, u, v;
  long long ans = 0, cnt = 1, cnt1 = 1;
  scanf("%d%d", &n, &m);
  pow2[0] = 1;
  for (int i = 1; i <= n; ++i) pow2[i] = pow2[i - 1] * 139LL;
  for (int i = 0; i < m; ++i) {
    scanf("%d%d", &u, &v);
    ph[u] += pow2[v];
    ph[v] += pow2[u];
    ph2[u] += pow2[v];
    ph2[v] += pow2[u];
  }
  for (int i = 1; i <= n; ++i) ph2[i] += pow2[i];
  sort(ph + 1, ph + n + 1);
  sort(ph2 + 1, ph2 + n + 1);
  ph[n + 1] = ph[n] + 1;
  ph2[n + 1] = ph2[n] + 1;
  for (int i = 2; i <= n + 1; ++i) {
    if (ph[i] == ph[i - 1])
      cnt++;
    else {
      ans += (cnt * (cnt - 1)) >> 1;
      cnt = 1;
    }
    if (ph2[i] == ph2[i - 1])
      cnt1++;
    else {
      ans += (cnt1 * (cnt1 - 1)) >> 1;
      cnt1 = 1;
    }
  }
  printf("%I64d", ans);
  return 0;
}
