#include <bits/stdc++.h>
using namespace std;
vector<vector<long long> > adj(1000010);
vector<long long> hsh(1000010), p2(1000010);
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long n, m, x, y, ans = 0;
  const long long mod = (1e9 + 7) * (1e9 + 9);
  cin >> n >> m;
  p2[0] = 1;
  for (long long i = 1; i <= n; i++) {
    p2[i] = p2[i - 1] << 1;
    if (p2[i] >= mod) p2[i] -= mod;
  }
  map<long long, long long> cnt;
  for (long long i = 0; i < m; i++) {
    cin >> x >> y;
    adj[min(x, y)].push_back(max(x, y));
    hsh[x] += p2[y];
    hsh[y] += p2[x];
    if (hsh[x] >= mod) hsh[x] -= mod;
    if (hsh[y] >= mod) hsh[y] -= mod;
  }
  for (long long i = 1; i <= n; i++) {
    ans += cnt[hsh[i]]++;
    long long a = hsh[i] + p2[i];
    if (a >= mod) a -= mod;
    for (auto &j : adj[i]) {
      long long b = hsh[j] + p2[j];
      if (b >= mod) b -= mod;
      if (a == b) ans++;
    }
  }
  cout << ans;
  return 0;
}
