#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
const long long INF = 1e18;
const int inf = 1e9 + 9;
inline int read() {
  int s = 0, w = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') w = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    s = (s << 3) + (s << 1) + (ch ^ 48);
    ch = getchar();
  }
  return s * w;
}
const int N = 2010000;
unsigned long long p[N];
int n, m;
int X[N], Y[N];
unsigned long long ha[N];
map<unsigned long long, int> Q;
int main() {
  int T = 1;
  p[0] = 1;
  for (int i = 1; i < N; i++) p[i] = p[i - 1] * 131;
  long long ans = 0;
  while (T--) {
    n = read();
    m = read();
    for (int i = 1; i <= m; i++) {
      int x = read(), y = read();
      X[i] = x;
      Y[i] = y;
      ha[x] += p[y];
      ha[y] += p[x];
    }
    for (int i = 1; i <= m; i++) {
      int x = X[i], y = Y[i];
      unsigned long long sumx = ha[x] + p[x], sumy = ha[y] + p[y];
      if (sumx == sumy) ans++;
    }
    for (int i = 1; i <= n; i++) {
      Q[ha[i]]++;
    }
    map<unsigned long long, int>::iterator it;
    for (it = Q.begin(); it != Q.end(); it++) {
      long long cnt = it->second;
      if (cnt < 2) continue;
      ans += cnt * (cnt - 1) / 2;
    }
  }
  printf("%lld\n", ans);
}
