#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 10;
int n, m, base = 31;
long long ans;
unsigned long long p[N], h[N];
pair<int, int> edge[N];
void preprocess() {
  memset(h, 0, sizeof(h));
  p[0] = 1;
  for (int i = 1; i <= n; i++) p[i] = p[i - 1] * base;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> m;
  preprocess();
  for (int i = 0; i < m; i++) {
    int u, v;
    cin >> u >> v;
    u--;
    v--;
    h[u] += p[v];
    h[v] += p[u];
    edge[i] = {u, v};
  }
  for (int i = 0; i < m; i++) {
    int u = edge[i].first, v = edge[i].second;
    if ((h[u] + p[u]) == (h[v] + p[v])) ans++;
  }
  sort(h, h + n);
  long long k = 1;
  for (int i = 1; i < n; i++) {
    if (h[i] == h[i - 1])
      k++;
    else {
      ans += (k * (k - 1)) / 2;
      k = 1;
    }
  }
  ans += (k * (k - 1)) / 2;
  cout << ans << '\n';
  return 0;
}
