#include <bits/stdc++.h>
using namespace std;
const long long MOD = 29645310968948039;
long long add(long long a, long long b) {
  if (a + b >= MOD) return a + b - MOD;
  return a + b;
}
long long mul(long long a, long long b) {
  if (b == 0) return 0;
  long long ans = mul(add(a, a), b / 2);
  if (b % 2 == 1) ans = add(ans, a);
  return ans;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  vector<long long> pw(n + 1);
  pw[0] = 1;
  for (int i = 1; i <= n; i++) pw[i] = mul(pw[i - 1], 2);
  vector<long long> a(n + 1, 0);
  for (int i = 0; i < m; i++) {
    int u, v;
    cin >> u >> v;
    a[u] = add(a[u], pw[v]);
    a[v] = add(a[v], pw[u]);
  }
  map<long long, int> mp;
  for (int i = 1; i <= n; i++) mp[a[i]]++;
  long long ans = 0;
  for (auto& p : mp) ans += (long long)p.second * (p.second - 1) / 2;
  for (int i = 1; i <= n; i++) a[i] = add(a[i], pw[i]);
  mp.clear();
  for (int i = 1; i <= n; i++) mp[a[i]]++;
  for (auto& p : mp) ans += (long long)p.second * (p.second - 1) / 2;
  cout << ans << '\n';
  return 0;
}
