#include <bits/stdc++.h>
using namespace std;
const int oo = 1000000000;
const int N = 1000100;
const unsigned long long MOD = 1000000007;
int cnt[N];
unsigned long long stk[N];
unsigned long long p[N];
int deg[N];
int recbf[N][2];
unsigned long long bspow(unsigned long long a, int b) {
  unsigned long long ans = 1;
  while (b) {
    if (b & 1) ans *= a;
    a = a * a;
    b >>= 1;
  }
  return ans;
}
int main() {
  int n, m;
  while (scanf("%d%d", &n, &m) != EOF) {
    int i, j;
    memset(cnt, 0, sizeof(cnt));
    memset(p, 0, sizeof(p));
    memset(deg, 0, sizeof(deg));
    for (i = 0; i < m; i++) {
      int x, y;
      scanf("%d%d", &x, &y);
      recbf[i][0] = x;
      recbf[i][1] = y;
      deg[x]++, deg[y]++;
      p[x] += bspow(MOD, y) * y;
      p[y] += bspow(MOD, x) * x;
    }
    int top = 0;
    for (i = 1; i <= n; i++) {
      if (deg[i]) stk[top++] = p[i];
    }
    sort(stk, stk + top);
    unsigned long long res = stk[0];
    int rec = 1;
    for (i = 1; i < top; i++) {
      if (stk[i] == res)
        rec++;
      else {
        res = stk[i];
        cnt[rec]++;
        rec = 1;
      }
    }
    cnt[rec]++;
    long long ans = 0;
    int temp = 0;
    for (i = 1; i <= n; i++)
      if (deg[i] == 0) temp++;
    ans += (long long)temp * (temp - 1) / 2;
    for (i = 2; i <= n; i++) ans += (long long)cnt[i] * i * (i - 1) / 2;
    for (i = 0; i < m; i++) {
      unsigned long long px = p[recbf[i][0]];
      unsigned long long py = p[recbf[i][1]];
      px += bspow(MOD, recbf[i][0]) * recbf[i][0];
      py += bspow(MOD, recbf[i][1]) * recbf[i][1];
      if (px == py) ans++;
    }
    cout << ans << endl;
  }
}
