#include <bits/stdc++.h>
using namespace std;
int u[1000005], v[1000005];
unsigned long long H[1000005], x[1000005];
int main() {
  H[0] = 1;
  for (int i = 1; i < 1000005; i++) H[i] = H[i - 1] * 7191;
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 0; i < m; i++) {
    scanf("%d%d", &u[i], &v[i]);
    x[u[i]] += H[v[i]];
    x[v[i]] += H[u[i]];
  }
  long long ans = 0;
  for (int i = 0; i < m; i++) {
    if (x[u[i]] - H[v[i]] == x[v[i]] - H[u[i]]) ans++;
  }
  sort(x + 1, x + 1 + n);
  long long cnt = 1;
  for (int i = 2; i <= n + 1; i++) {
    if (i <= n && x[i] == x[i - 1]) {
      cnt++;
    } else {
      ans += cnt * (cnt - 1) / 2;
      cnt = 1;
    }
  }
  printf("%lld\n", ans);
}
