#include <bits/stdc++.h>
const long long LUCK(1049209490586201);
int n, m;
long long ans, pow2[1000001], hash[1000000];
std::pair<int, int> e[1000000];
int main() {
  scanf("%d%d", &n, &m);
  pow2[0] = 1;
  for (int i = 1; i <= n; ++i) pow2[i] = pow2[i - 1] * 2 % LUCK;
  for (int i = 0; i < m; ++i) {
    scanf("%d%d", &e[i].first, &e[i].second);
    --e[i].first, --e[i].second;
    hash[e[i].first] = (hash[e[i].first] + pow2[e[i].second]) % LUCK;
    hash[e[i].second] = (hash[e[i].second] + pow2[e[i].first]) % LUCK;
  }
  std::sort(hash, hash + n);
  for (int i = 0, j; i < n; i = j) {
    for (j = i + 1; j < n && hash[i] == hash[j]; ++j)
      ;
    ans += static_cast<long long>(j - i) * (j - i - 1) / 2;
  }
  for (int i = 0; i < n; ++i) hash[i] = pow2[i];
  for (int i = 0; i < m; ++i) {
    hash[e[i].first] = (hash[e[i].first] + pow2[e[i].second]) % LUCK;
    hash[e[i].second] = (hash[e[i].second] + pow2[e[i].first]) % LUCK;
  }
  std::sort(hash, hash + n);
  for (int i = 0, j; i < n; i = j) {
    for (j = i + 1; j < n && hash[i] == hash[j]; ++j)
      ;
    ans += static_cast<long long>(j - i) * (j - i - 1) / 2;
  }
  printf("%I64d", ans);
}
