#include <bits/stdc++.h>
using namespace std;
int n;
vector<int> adj[1000001];
unsigned long long ha[1000001], hb[1000001];
int main() {
  int m, u, v;
  scanf("%d %d", &n, &m);
  while (m--) {
    scanf("%d %d", &u, &v);
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  for (int i = (1), _b = (n); i <= _b; i++) {
    sort(adj[i].begin(), adj[i].end());
    ha[i] = 0;
    for (int j = 0, _n = (adj[i].size()); j < _n; j++)
      ha[i] = ha[i] * 9875321 + adj[i][j];
    adj[i].push_back(i);
    sort(adj[i].begin(), adj[i].end());
    hb[i] = 0;
    for (int j = 0, _n = (adj[i].size()); j < _n; j++)
      hb[i] = hb[i] * 9875321 + adj[i][j];
  }
  long long res = 0LL;
  int lastA = 1, lastB = 1;
  sort(ha + 1, ha + n + 1);
  sort(hb + 1, hb + n + 1);
  ha[n + 1] = ha[n] + 1;
  hb[n + 1] = hb[n] + 1;
  for (int i = (2), _b = (n + 1); i <= _b; i++) {
    if (ha[i] != ha[i - 1]) {
      res += ((i - lastA) * (long long)(i - lastA - 1)) / 2;
      lastA = i;
    }
    if (hb[i] != hb[i - 1]) {
      res += ((i - lastB) * (long long)(i - lastB - 1)) / 2;
      lastB = i;
    }
  }
  cout << res << endl;
  return 0;
}
