#include <bits/stdc++.h>
using namespace std;
long long power[1000001];
long long hashVal[1000001];
vector<pair<int, int> > edge;
int b = 31;
map<long long, int> mp;
void pre() {
  power[0] = 1LL;
  for (int i = 1; i < 1000001; i++) {
    power[i] = (power[i - 1] * b);
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  pre();
  int n, m;
  cin >> n >> m;
  int i, u, v;
  for (i = 0; i < m; i++) {
    cin >> u >> v;
    hashVal[u] += power[v];
    hashVal[v] += power[u];
    edge.push_back(pair<int, int>(u, v));
  }
  long long ans = 0;
  for (i = 0; i < m; i++) {
    u = edge[i].first;
    v = edge[i].second;
    if (hashVal[u] + power[u] == hashVal[v] + power[v]) ans++;
  }
  for (i = 1; i <= n; i++) {
    mp[hashVal[i]]++;
  }
  long long c;
  for (auto &it : mp) {
    c = it.second;
    if (c > 1) {
      ans += (c * (c - 1)) / 2;
    }
  }
  cout << ans;
  return 0;
}
