#include <bits/stdc++.h>
using namespace std;
long long int powers[1000100];
vector<pair<int, int> > edges;
unsigned long long hashes[1000100] = {0};
unsigned long long ts[1000100] = {0};
int main(void) {
  powers[0] = 1;
  for (int i = 1; i <= 1000000; i++)
    powers[i] = (powers[i - 1] * (unsigned long long)41) % 291598227841757;
  int n, m;
  scanf("%d %d", &n, &m);
  for (int i = 0; i < m; i++) {
    int u, v;
    scanf("%d %d", &u, &v);
    hashes[u] = (hashes[u] + powers[v]) % 291598227841757;
    hashes[v] = (hashes[v] + powers[u]) % 291598227841757;
    ts[u - 1] = hashes[u];
    ts[v - 1] = hashes[v];
    edges.push_back(make_pair(u, v));
  }
  sort(ts, ts + n);
  int cur = 0;
  long long int ans = 0;
  for (int i = 1; i < n; i++) {
    if (ts[i] != ts[cur]) {
      long long int n = i - cur;
      ans += n * (n - 1) / 2;
      cur = i;
    }
  }
  long long int a = n - cur;
  ans += a * (a - 1) / 2;
  for (int i = 0; i < m; i++) {
    int u = edges[i].first, v = edges[i].second;
    unsigned long long hu = (hashes[u] + powers[u]) % 291598227841757;
    unsigned long long hv = (hashes[v] + powers[v]) % 291598227841757;
    if (hu == hv) ans++;
  }
  cout << ans << endl;
  return 0;
}
