#include <bits/stdc++.h>
using namespace std;
int n, m;
long long pw[1000010];
long long hs[1000010];
vector<int> adj[1000010];
long long calc() {
  long long res = 0;
  for (int i = 0; i < n; i++) {
    hs[i] = 0;
    for (int j = 0; j < adj[i].size(); j++) {
      hs[i] += pw[adj[i][j]];
      if (hs[i] >= 1000000000000037LL) hs[i] -= 1000000000000037LL;
    }
  }
  sort(hs, hs + n);
  long long cnt = 0;
  for (int i = 0; i < n; i++) {
    cnt++;
    if (i == n - 1 || hs[i] != hs[i + 1]) {
      res += cnt * (cnt - 1) / 2;
      cnt = 0;
    }
  }
  return res;
}
int main() {
  cin >> n >> m;
  pw[0] = 1;
  for (int i = 1; i < n; i++) {
    pw[i] = pw[i - 1] + pw[i - 1];
    if (pw[i] >= 1000000000000037LL) pw[i] -= 1000000000000037LL;
  }
  int a, b;
  for (int i = 0; i < m; i++) {
    scanf("%d%d", &a, &b);
    a--, b--;
    adj[a].push_back(b);
    adj[b].push_back(a);
  }
  long long res = calc();
  for (int i = 0; i < n; i++) adj[i].push_back(i);
  res += calc();
  cout << res << endl;
  return 0;
}
