#include <bits/stdc++.h>
using namespace std;
long long pw[1200000];
long n, m, a[1200000], b[1200000];
long long ans;
vector<long> g[1200000];
long long s[1200000];
long long t1, t2;
vector<long long> d;
long long calc;
int main() {
  ios_base::sync_with_stdio(0);
  pw[0] = 1;
  for (int i = 1; i <= 1000000; i++) pw[i] = pw[i - 1] * 17;
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    cin >> a[i] >> b[i];
    g[a[i]].push_back(b[i]);
    g[b[i]].push_back(a[i]);
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j < g[i].size(); j++) {
      s[i] += pw[g[i][j]];
    }
    d.push_back(s[i]);
  }
  sort(d.begin(), d.end());
  calc = 0;
  for (int i = 0; i < d.size(); i++) {
    if (i > 0 && d[i] != d[i - 1]) {
      ans += 1ll * calc * (calc - 1) / 2;
      calc = 1;
    } else
      ++calc;
  }
  ans += 1ll * calc * (calc - 1) / 2;
  for (int i = 1; i <= m; i++) {
    t1 = s[a[i]];
    t2 = s[b[i]];
    t1 -= pw[b[i]];
    t2 -= pw[a[i]];
    if (t1 == t2) ++ans;
  }
  cout << ans << endl;
  cin.get();
  cin.get();
  return 0;
}
