#include <bits/stdc++.h>
using namespace std;
const long long maxn = 2e6 + 10;
const long long x = 233;
long long n, m, ans = 0, idx = 0, f = 0;
long long pw[maxn], hashh[maxn];
vector<long long> g[maxn], hashs;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  pw[0] = 1;
  for (long long i = 1; i <= n; i++) {
    pw[i] = (pw[i - 1] * x);
  }
  for (long long i = 0, v, u; i < m; i++) {
    cin >> v >> u;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  for (long long i = 1; i <= n; i++) {
    sort(g[i].begin(), g[i].end());
    for (long long j = 0; j < g[i].size(); j++) {
      hashh[i] += pw[g[i][j]];
    }
    hashs.push_back(hashh[i]);
  }
  sort(hashs.begin(), hashs.end());
  idx = 0;
  ans = 0;
  for (long long i = 0; i < n; i++) {
    if (hashs[i] != hashs[i - 1]) {
      long long f = i - idx;
      ans += f * (f - 1) / 2;
      idx = i;
    }
  }
  long long f = n - idx;
  ans += f * (f - 1) / 2;
  hashs.clear();
  for (long long i = 1; i <= n; i++) {
    hashh[i] = 0;
    g[i].push_back(i);
    sort(g[i].begin(), g[i].end());
  }
  for (long long i = 1; i <= n; i++) {
    sort(g[i].begin(), g[i].end());
    for (long long j = 0; j < g[i].size(); j++) {
      hashh[i] += pw[g[i][j]];
    }
    hashs.push_back(hashh[i]);
  }
  sort(hashs.begin(), hashs.end());
  idx = 0;
  for (long long i = 0; i < n; i++) {
    if (hashs[i] != hashs[i - 1]) {
      f = i - idx;
      ans += f * (f - 1) / 2;
      idx = i;
    }
  }
  f = n - idx;
  ans += f * (f - 1) / 2;
  cout << ans;
  return 0;
}
