#include <bits/stdc++.h>
using namespace std;
long long int hash_val[1000007];
pair<int, int> ara[1000007];
long long int hashi[1000007];
int main() {
  int t, tst = 1;
  long long int p = 47;
  hashi[0] = 1;
  for (int i = 1; i <= (1000007 - 1); i++) hashi[i] = (hashi[i - 1] * p);
  int n, m;
  scanf("%d %d", &n, &m);
  for (int i = 0; i < (m); i++) {
    int u, v;
    scanf("%d %d", &u, &v);
    ara[i] = pair<int, int>(u, v);
    hash_val[u] = (hash_val[u] + hashi[v]);
    hash_val[v] = (hash_val[v] + hashi[u]);
  }
  map<long long int, int> mp;
  long long int ans = 0;
  for (int i = 0; i < (m); i++) {
    int u = ara[i].first;
    int v = ara[i].second;
    if ((hash_val[u] + hashi[u]) == (hash_val[v] + hashi[v])) ans++;
  }
  for (int i = 1; i <= (n); i++) mp[hash_val[i]]++;
  for (pair<long long int, int> x : mp) {
    long long int tt = x.second;
    ans += tt * (tt - 1) / 2;
  }
  cout << ans << endl;
  return 0;
}
