#include <bits/stdc++.h>
using namespace std;
const int INF = 1 << 29;
const double EPS = 1e-10;
const int SZ = 1000007;
long long H[SZ];
long long p[SZ];
vector<int> G[SZ];
map<long long, long long> memo;
int main() {
  int n, m, u, v;
  p[0] = 1;
  for (int i = 0; i < 1000000; i++) p[i + 1] = p[i] * 59;
  scanf("%d%d", &n, &m);
  for (int i = 0; i < m; i++) {
    scanf("%d%d", &u, &v);
    u--, v--;
    H[u] += p[v];
    H[v] += p[u];
    G[u].push_back(v);
  }
  long long res = 0;
  for (int i = 0; i < n; i++) memo[H[i]]++;
  for (map<long long, long long>::iterator iter = memo.begin();
       iter != memo.end(); iter++) {
    res += (iter->second * (iter->second - 1)) / 2;
  }
  for (int i = 0; i < n; i++)
    for (int j = 0; j < (int)G[i].size(); j++) {
      if (H[i] + p[i] == H[G[i][j]] + p[G[i][j]]) res++;
    }
  cout << res << endl;
  return 0;
}
