#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:16777216")
using namespace std;
const double eps = 1e-9;
const double pi = acos(-1.0);
const int maxn = (int)1e6 + 10;
int a[maxn], b[maxn];
long long h[maxn], pw[maxn];
int main() {
  int n, m;
  cin >> n >> m;
  const int p = 31;
  pw[0] = 1;
  for (int i = 1; i < maxn; i++) pw[i] = pw[i - 1] * p;
  for (int i = 0; i < m; i++) {
    scanf("%d%d", &a[i], &b[i]);
    --a[i];
    --b[i];
    h[a[i]] += pw[b[i]];
    h[b[i]] += pw[a[i]];
  }
  long long res = 0;
  for (int i = 0; i < m; i++)
    if (h[a[i]] + pw[a[i]] == h[b[i]] + pw[b[i]]) res++;
  sort(h, h + n);
  int j = 0;
  for (int i = 0; i < n; i++)
    if (i && h[i] != h[i - 1]) {
      res = res + (long long)j * (j - 1) / 2;
      j = 1;
    } else
      j++;
  res = res + (long long)j * (j - 1) / 2;
  cout << res << endl;
  return 0;
}
