#include <bits/stdc++.h>
using namespace std;
const int INF = 2147483647;
const long long LLINF = 9223372036854775807LL;
const int maxn = 1000010;
unsigned long long p[maxn] = {};
vector<int> a[maxn] = {};
unsigned long long h[maxn] = {};
struct edge {
  unsigned long long h;
  int count;
  int next;
  edge() {}
};
edge t[maxn] = {};
const int htsize = 4000237;
int ht[htsize] = {};
int mem = 0;
int findval(unsigned long long hhh) {
  int curpos = hhh % htsize;
  for (int i = ht[curpos]; i != -1; i = t[i].next) {
    if (t[i].h == hhh) return i;
  }
  return -1;
}
void insert(unsigned long long hhh) {
  int curpos = hhh % htsize;
  t[mem].h = hhh;
  t[mem].count = 1;
  t[mem].next = ht[curpos];
  ht[curpos] = mem++;
}
int main() {
  memset(ht, -1, sizeof(ht));
  int n, m;
  scanf("%d%d", &n, &m);
  long long ans = 0;
  for (int i = 0; i < m; ++i) {
    int u, v;
    scanf("%d%d", &u, &v);
    u--;
    v--;
    a[u].push_back(v);
    a[v].push_back(u);
  }
  p[0] = 1;
  for (int i = 1; i <= n; ++i) p[i] = p[i - 1] * 2453743;
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < a[i].size(); ++j) h[i] += p[a[i][j]];
  }
  map<long long, int> cnt;
  for (int i = 0; i < n; ++i) {
    int it = findval(h[i]);
    if (it != -1) {
      ans += t[it].count;
    }
    for (int j = 0; j < a[i].size(); ++j) {
      int cur = a[i][j];
      if (cur < i) {
        if (h[i] - p[cur] + p[i] == h[cur]) ans++;
      }
    }
    if (it == -1)
      insert(h[i]);
    else
      t[it].count++;
  }
  cout << ans << endl;
  return 0;
}
