#include <bits/stdc++.h>
using namespace std;
inline long long f(long long x) { return x * (x - 1) / 2; }
int32_t main(void) {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long i, j;
  long long n, m;
  cin >> n >> m;
  vector<pair<long long, long long> > pairs;
  vector<long long> peeps(n);
  long long powers[1010000];
  powers[0] = 1;
  for (i = 1; i < 1010000; i++) powers[i] = powers[i - 1] * 7;
  for (i = 0; i < m; i++) {
    long long u, v;
    cin >> u >> v;
    u--;
    v--;
    peeps[u] += powers[v];
    peeps[v] += powers[u];
    pairs.push_back(make_pair(u, v));
  }
  long long ans = 0;
  for (auto x : pairs) {
    long long u = x.first;
    long long v = x.second;
    if (peeps[u] + powers[u] == peeps[v] + powers[v]) ans++;
  }
  unordered_map<long long, long long> ump;
  for (long long i = 0; i < n; i++) ump[peeps[i]]++;
  for (auto x : ump) ans += f(x.second);
  cout << ans << "\n";
  return 0;
}
