#include <bits/stdc++.h>
using namespace std;
vector<int> g[1000005];
map<long long, int> dp;
map<long long, int>::iterator its;
long long r[1000005];
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
long long rng2(long long mx) {
  return (rng() % (1 << 30) * (1ll << 30) + rng() % (1 << 30)) % mx;
}
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) r[i] = rng2(1e18);
  for (int i = 1; i <= m; i++) {
    int a, b;
    scanf("%d%d", &a, &b);
    g[a].emplace_back(b);
    g[b].emplace_back(a);
  }
  for (int i = 1; i <= n; i++) {
    vector<int> v;
    v.emplace_back(i);
    for (int j = 0; j < g[i].size(); j++) v.emplace_back(g[i][j]);
    long long sum = 0;
    for (int j = 0; j < v.size(); j++) sum ^= r[v[j]];
    dp[sum]++;
  }
  long long ans = 0;
  for (its = dp.begin(); its != dp.end(); its++)
    ans += its->second * 1ll * (its->second - 1) / 2;
  dp.clear();
  for (int i = 1; i <= n; i++) {
    vector<int> v;
    for (int j = 0; j < g[i].size(); j++) v.emplace_back(g[i][j]);
    long long sum = 0;
    for (int j = 0; j < v.size(); j++) sum ^= r[v[j]];
    dp[sum]++;
  }
  for (its = dp.begin(); its != dp.end(); its++)
    ans += its->second * 1ll * (its->second - 1) / 2;
  printf("%lld\n", ans);
}
