#include <bits/stdc++.h>
using namespace std;
const int N = 1e6;
int n, ne;
long long res = 0;
unsigned long long a[N], b[N], pw[N];
int main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  cin >> n >> ne, pw[0] = 1;
  for (int i = (1); i < (n); ++i) {
    pw[i] = pw[i - 1] * 3;
  }
  for (int i = (0); i < (n); ++i) {
    a[i] = pw[i];
  }
  for (int i = (0); i < (ne); ++i) {
    int u, v;
    cin >> u >> v, --u, --v;
    a[u] += pw[v], b[u] += pw[v];
    a[v] += pw[u], b[v] += pw[u];
  }
  sort(a, a + n), sort(b, b + n);
  for (int l = 0, r = 0; l < n; l = r) {
    for (; r < n and a[l] == a[r]; ++r)
      ;
    res += 1ll * (r - l) * (r - l - 1) / 2;
  }
  for (int l = 0, r = 0; l < n; l = r) {
    for (; r < n and b[l] == b[r]; ++r)
      ;
    res += 1ll * (r - l) * (r - l - 1) / 2;
  }
  cout << res << '\n';
  return 0;
}
