#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 5;
long long pwr1[N], pwr2[N], pr1[N], pr2[N], ans;
int n, m, u, v, k, p1, p2, i, mod1, mod2;
vector<int> V[N];
map<pair<long long, long long>, int> fix;
int main() {
  scanf("%d %d", &n, &m);
  for (k = 1; k <= m; k++) {
    scanf("%d %d", &u, &v);
    V[u].push_back(v);
    V[v].push_back(u);
  }
  p1 = 29;
  mod1 = 1e9 + 7;
  p2 = 31;
  mod2 = 1e9 + 9;
  pwr1[0] = pwr2[0] = 1;
  for (k = 1; k <= n; k++) {
    pwr1[k] = pwr1[k - 1] * p1 % mod1;
    pwr2[k] = pwr2[k - 1] * p2 % mod2;
  }
  for (k = 1; k <= n; k++) {
    sort(V[k].begin(), V[k].end());
    for (i = 1; i <= V[k].size(); i++) {
      pr1[i] = (pr1[i - 1] + (pwr1[i - 1] * V[k][i - 1]) % mod1) % mod1;
      pr2[i] = (pr2[i - 1] + (pwr2[i - 1] * V[k][i - 1]) % mod2) % mod2;
    }
    ans += fix[{pr1[V[k].size()], pr2[V[k].size()]}];
    fix[{pr1[V[k].size()], pr2[V[k].size()]}]++;
    V[k].push_back(k);
    sort(V[k].begin(), V[k].end());
    for (i = 1; i <= V[k].size(); i++) {
      pr1[i] = (pr1[i - 1] + (pwr1[i - 1] * V[k][i - 1]) % mod1) % mod1;
      pr2[i] = (pr2[i - 1] + (pwr2[i - 1] * V[k][i - 1]) % mod2) % mod2;
    }
    ans += fix[{pr1[V[k].size()], pr2[V[k].size()]}];
    fix[{pr1[V[k].size()], pr2[V[k].size()]}]++;
  }
  printf("%lld", ans);
}
