#include <bits/stdc++.h>
using namespace std;
template <typename T>
T getint() {
  T x = 0, p = 1;
  char ch;
  do {
    ch = getchar();
  } while (ch <= ' ');
  if (ch == '-') p = -1, ch = getchar();
  while (ch >= '0' && ch <= '9') x = x * 10 + ch - '0', ch = getchar();
  return x * p;
}
mt19937 gen(chrono::system_clock::now().time_since_epoch().count());
template <typename T1, typename T2>
bool umin(T1 &x, const T2 &y) {
  if (x > y) return x = y, true;
  return false;
}
template <typename T1, typename T2>
bool umax(T1 &x, const T2 &y) {
  if (x < y) return x = y, true;
  return false;
}
const int maxn = (int)1e6 + 10;
const int inf = (int)1e9 + 5;
const int mod = (int)1e9 + 7;
const long long llinf = (long long)1e18 + 5;
const double pi = acos(-1.0);
map<pair<long long, long long>, int> cnt;
map<pair<long long, long long>, int> num;
int z;
int pos[maxn];
vector<int> g[maxn];
int x[maxn], y[maxn];
int main() {
  int n, m;
  n = getint<int>();
  m = getint<int>();
  for (int i = (0); i < (m); i++) {
    x[i] = getint<int>();
    y[i] = getint<int>();
    g[x[i]].push_back(y[i]);
    g[y[i]].push_back(x[i]);
  }
  auto prime = [](long long x) -> bool {
    for (long long i = 2; i * i <= x; ++i)
      if (x % i == 0) return false;
    return true;
  };
  long long mod = gen() % 1234567890;
  while (!prime(mod)) mod++;
  int base = 1000000 + gen() % 100000;
  while (!prime(base)) base++;
  long long mod2 = gen() % 2223334445;
  while (!prime(mod2)) mod2++;
  int base2 = 4500000 + gen() % 100000;
  while (!prime(base2)) base2++;
  long long res = 0;
  for (int i = (1); i < (n + 1); i++) {
    sort((g[i]).begin(), (g[i]).end());
    long long h = 0, H = 0;
    for (int j = (0); j < (g[i].size()); j++) {
      h = (h * base + g[i][j]) % mod;
      H = (H * base2 + g[i][j]) % mod2;
    }
    res += cnt[make_pair(h, H)]++;
    vector<int> &y = g[i];
    int sz = g[i].size();
    int ptr = 0, j = 0;
    long long h2 = 0, H2 = 0;
    while (j < sz && y[j] < i) {
      h2 = (h2 * base + y[j]) % mod;
      H2 = (H2 * base2 + y[j++]) % mod2;
    }
    h2 = (h2 * base + i) % mod;
    H2 = (H2 * base2 + i) % mod2;
    while (j < sz) {
      h2 = (h2 * base + y[j]) % mod;
      H2 = (H2 * base2 + y[j++]) % mod2;
    }
    int &x = num[make_pair(h2, H2)];
    if (x == 0) x = ++z;
    pos[i] = x;
  }
  for (int i = (0); i < (m); i++) {
    if (pos[x[i]] == pos[y[i]]) res++;
  }
  printf("%I64d\n", res);
  return 0;
}
