#include <bits/stdc++.h>
using namespace std;
const int OO = 1e9;
const double EPS = 1e-9;
const int MX = 1e6 + 5;
int p = 1299709, n, m, u, v;
vector<vector<int>> adj(MX);
unsigned long long pPw[MX], M = 1000000009, Hash[MX];
int main() {
  ios::sync_with_stdio(false);
  cout.precision(10);
  cin.tie(0);
  pPw[0] = 1;
  for (int i = 1; i < MX; ++i) pPw[i] = p * pPw[i - 1];
  cin >> n >> m;
  for (int i = 0; i < m; ++i) {
    cin >> u >> v;
    for (int I = 0; I < 1; ++I) {
      Hash[u] += pPw[v];
      Hash[v] += pPw[u];
    }
  }
  map<unsigned long long, int> hashes;
  for (int i = 1; i <= n; ++i) {
    ++hashes[Hash[i]];
  }
  unsigned long long ans = 0;
  for (auto& pr : hashes) {
    ans += pr.second * 1LL * (pr.second - 1) / 2;
  }
  hashes.clear();
  for (int i = 1; i <= n; ++i) {
    ++hashes[Hash[i] + pPw[i]];
  }
  for (auto& pr : hashes) {
    ans += pr.second * 1LL * (pr.second - 1) / 2;
  }
  cout << ans << '\n';
  return 0;
}
