#include <bits/stdc++.h>
using namespace std;
template <class S, class T>
inline S smax(S &l, T r) {
  return l = max(l, (S)r);
}
template <class S, class T>
inline S smin(S &l, T r) {
  return l = min(l, (S)r);
}
const unsigned long long N = 1e6 + 10, V = 737, md = 1e9 + 7;
unsigned long long dp[N], pw[N], dp1[N], A[N], B[N];
vector<unsigned long long> g[N];
int32_t main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  unsigned long long n, m;
  cin >> n >> m;
  pw[0] = 1;
  for (unsigned long long i = 1; i <= n; ++i) pw[i] = (pw[i - 1] * V);
  for (unsigned long long i = 0; i < m; ++i) {
    unsigned long long u, v;
    cin >> u >> v;
    A[i] = u, B[i] = v;
    dp[u] += pw[v - 1];
    dp1[u] += pw[v - 1];
    dp[v] += pw[u - 1];
    dp1[v] += pw[u - 1];
  }
  sort(dp + 1, dp + n + 1);
  unsigned long long sz = 1, ans = 0;
  dp[n + 1] = dp[n] + 1;
  for (unsigned long long i = 1; i < n + 1; ++i)
    if (dp[i] == dp[i + 1])
      sz++;
    else {
      ans += ((sz * (sz - 1)) / 2);
      sz = 1;
    }
  for (unsigned long long i = 0; i < m; ++i)
    if ((dp1[A[i]] - pw[B[i] - 1] + md) == (dp1[B[i]] - pw[A[i] - 1] + md))
      ans++;
  cout << ans << '\n';
  return 0;
}
