#include <bits/stdc++.h>
using namespace std;
long long int const delta = (long long int)1e18 + 8;
vector<long long int> G[(long long int)1e6 + 8];
map<long long int, long long int> cnt;
long long int hsh[(long long int)1e6 + 8];
long long int pow2[(long long int)1e6 + 8];
vector<pair<long long int, long long int> > Edges;
int main() {
  std::ios::sync_with_stdio(0);
  ;
  cin.tie(0);
  cout.tie(0);
  long long int n, m;
  cin >> n >> m;
  long long int f, s;
  for (long long int i = 0; i < m; i++) {
    cin >> f >> s;
    G[f].push_back(s);
    ;
    G[s].push_back(f);
    ;
    Edges.push_back(make_pair(f, s));
    ;
  }
  pow2[0] = 1;
  for (long long int i = 1; i < (long long int)1e6 + 8; i++) {
    pow2[i] = 3 * pow2[i - 1];
    pow2[i] %= delta;
  }
  for (long long int i = 1; i <= n; i++) {
    for (long long int j = 0; j < G[i].size(); j++) {
      hsh[i] += pow2[G[i][j]];
      hsh[i] %= delta;
    }
    cnt[hsh[i]]++;
  }
  long long int ans = 0;
  for (long long int i = 1; i <= n; i++) {
    long long int t = cnt[hsh[i]];
    ans += ((t - 1) * t / 2);
    ans %= delta;
    cnt[hsh[i]] = 0;
  }
  for (long long int i = 0; i < Edges.size(); i++) {
    f = Edges[i].first;
    s = Edges[i].second;
    long long int a = hsh[f];
    long long int b = hsh[s];
    a += delta;
    a -= pow2[s];
    b += delta;
    b -= pow2[f];
    a %= delta;
    b %= delta;
    if (a == b) {
      ans++;
      ans %= delta;
    }
  }
  cout << ans;
  return 0;
}
