#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e9;
const long long mod = 1e18 + 7;
long long p;
void solve() {
  int n, m;
  scanf("%d %d", &n, &m);
  vector<vector<long long>> g(n);
  for (long long i = 0; i < m; ++i) {
    int a, b;
    scanf("%d %d", &a, &b);
    --a;
    --b;
    g[a].push_back(b + 1);
    g[b].push_back(a + 1);
  }
  vector<long long> h;
  for (long long i = 0; i < n; ++i) {
    sort(g[i].begin(), g[i].end());
    long long hash = 0;
    long long curp = p;
    for (long long j = 0; j < g[i].size(); ++j) {
      hash += ((long long)g[i][j] * curp) % mod;
      hash %= mod;
      curp *= p;
      curp %= mod;
    }
    h.push_back(hash);
  }
  long long ans = 0;
  sort(h.begin(), h.end());
  long long cnt = 0;
  long long cur = h[0];
  for (long long i = 0; i < n; ++i) {
    if (h[i] == cur)
      ++cnt;
    else {
      ans += cnt * (cnt - 1) / 2;
      cnt = 1;
      cur = h[i];
    }
  }
  ans += cnt * (cnt - 1) / 2;
  h.clear();
  for (long long i = 0; i < n; ++i) {
    g[i].push_back(i + 1);
    sort(g[i].begin(), g[i].end());
    long long hash = 0;
    long long curp = p;
    for (long long j = 0; j < g[i].size(); ++j) {
      hash += ((long long)g[i][j] * curp) % mod;
      hash %= mod;
      curp *= p;
      curp %= mod;
    }
    h.push_back(hash);
  }
  sort(h.begin(), h.end());
  cnt = 0;
  cur = h[0];
  for (long long i = 0; i < n; ++i) {
    if (h[i] == cur)
      ++cnt;
    else {
      ans += cnt * (cnt - 1) / 2;
      cnt = 1;
      cur = h[i];
    }
  }
  ans += cnt * (cnt - 1) / 2;
  printf("%I64d", ans);
}
int main() {
  srand(time(NULL));
  p = rand() % 1000 + 1e8;
  solve();
  return 0;
}
