#include <bits/stdc++.h>
using namespace std;
const int maxn = 1000 * 1000 + 3;
long long hashh[maxn], f[maxn], nei[maxn], n, m;
const long long mod = 1e9 + 7, base = 97;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  f[0] = 1;
  for (int i = 1; i <= n; i++) f[i] = f[i - 1] * base;
  for (int i = 0; i < m; i++) {
    int x, y;
    cin >> x >> y;
    nei[x] += f[y];
    nei[y] += f[x];
  }
  for (int i = 1; i <= n; i++) hashh[i] = nei[i] + f[i];
  sort(hashh + 1, hashh + n + 1);
  sort(nei + 1, nei + n + 1);
  long long ans = 0, ans_ = 0;
  for (int i = 2; i <= n; i++) {
    if (nei[i] == nei[i - 1])
      ans_++, ans += ans_;
    else
      ans_ = 0;
  }
  ans_ = 0;
  for (int i = 2; i <= n; i++) {
    if (hashh[i] == hashh[i - 1])
      ans_++, ans += ans_;
    else
      ans_ = 0;
  }
  cout << ans;
}
