#include <bits/stdc++.h>
using namespace std;
const int MAX_N = (int)(1e6);
vector<int> graph[MAX_N];
int N, M;
unsigned long long xors[MAX_N];
unsigned long long hs[MAX_N];
void init() {
  scanf("%d%d", &N, &M);
  for (int i = 0; i < N; i++) {
    hs[i] = (unsigned long long)rand() * (unsigned long long)rand() *
                (unsigned long long)rand() +
            (unsigned long long)rand();
  }
  for (int i = 0; i < M; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    x--;
    y--;
    xors[x] = xors[x] ^ hs[y];
    xors[y] = xors[y] ^ hs[x];
    graph[x].push_back(y);
    graph[y].push_back(x);
  }
}
long long solve() {
  long long ans = 0;
  unordered_map<unsigned long long, int> appear;
  for (int i = 0; i < N; i++) {
    appear[xors[i]]++;
  }
  for (int i = 0; i < N; i++) {
    ans += appear[xors[i]] - 1;
    for (int j = 0; j < (int)graph[i].size(); j++) {
      const int x = graph[i][j];
      if (xors[i] == xors[x]) {
        ans--;
      } else if ((xors[i] ^ hs[x]) == (xors[x] ^ hs[i])) {
        ans++;
      }
    }
  }
  return ans / 2;
}
int main() {
  init();
  cout << solve() << endl;
  return 0;
}
