#include <bits/stdc++.h>
using namespace std;
const int N = 1000010;
long long g[N][2];
long long n, m;
long long ha[N];
long long p[N];
int main() {
  scanf("%lld%lld", &n, &m);
  p[1] = 1;
  for (int i = 2; i <= n; i++) p[i] = p[i - 1] * 3;
  int u, v;
  for (int i = 0; i < m; i++) {
    scanf("%d%d", &u, &v);
    ha[u] += p[v];
    ha[v] += p[u];
    g[i][0] = u;
    g[i][1] = v;
  }
  long long ans = 0;
  for (int i = 0; i < m; i++) {
    int a = g[i][0], b = g[i][1];
    if (ha[a] + p[a] == ha[b] + p[b]) ans++;
  }
  sort(ha + 1, ha + n + 1);
  long long i, j;
  for (i = 1; i <= n; i = j) {
    for (j = i; j <= n && ha[i] == ha[j]; j++)
      ;
    ans += (j - i) * (j - i - 1) / 2;
  }
  printf("%lld\n", ans);
}
