#include <bits/stdc++.h>
using namespace std;
unsigned long long POW[1000010];
unsigned long long a[1000010];
int e[1000010][2];
int n, m;
long long ans;
int main() {
  POW[0] = 1;
  for (int i = 1; i < 1000010; i++) POW[i] = POW[i - 1] * 31;
  scanf("%d%d", &n, &m);
  for (int i = 0; i < m; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    --u;
    --v;
    a[u] += POW[v] * 13;
    a[v] += POW[u] * 13;
    e[i][0] = u;
    e[i][1] = v;
  }
  ans = 0;
  for (int i = 0; i < m; i++) {
    int u = e[i][0], v = e[i][1];
    unsigned long long t1 = a[u] - POW[v] * 13;
    unsigned long long t2 = a[v] - POW[u] * 13;
    if (t1 == t2) ++ans;
  }
  sort(a, a + n);
  for (int i = 0, j; i < n; i = j + 1) {
    for (j = i; j < n - 1 && a[j + 1] == a[j]; j++)
      ;
    long long tmp = j - i + 1;
    ans += tmp * (tmp - 1) / 2;
  }
  printf("%I64d\n", ans);
  return 0;
}
