#include <bits/stdc++.h>
using namespace std;
vector<vector<int>> graph(1000008);
vector<pair<long long, long long>> f, s;
long long Hash = 0;
long long Hash2 = 0;
const int base = 7;
const int base2 = 11;
const int MOD = 1e9 + 7;
const int Mod2 = 1e9 + 9;
long long check(vector<pair<long long, long long>> &vc) {
  long long res = 0;
  int sz = (int)vc.size();
  int l = 0;
  for (int i = 0; i < sz; i++) {
    while (l < sz - 1 && vc[l + 1] == vc[i]) l++;
    res += 1LL * (l - i) * (l - i + 1) / 2;
    i = l;
  }
  return res;
}
int main() {
  int n, m, u, v;
  scanf("%d %d", &n, &m);
  for (int i = 0; i < m; ++i) {
    scanf("%d %d", &u, &v);
    graph[u].push_back(v);
    graph[v].push_back(u);
  }
  for (int i = 1; i <= n; i++) {
    sort(graph[i].begin(), graph[i].end());
    Hash = 0;
    Hash2 = 0;
    for (int j = 0; j < graph[i].size(); j++) {
      Hash2 = 1LL * (1LL * Hash2 * base2 % Mod2 + graph[i][j]) % Mod2;
      Hash = 1LL * (1LL * Hash * base % MOD + graph[i][j]) % MOD;
    }
    f.push_back(make_pair(Hash, Hash2));
    Hash = 0, Hash2 = 0;
    graph[i].push_back(i);
    sort(graph[i].begin(), graph[i].end());
    for (int j = 0; j < graph[i].size(); j++) {
      Hash2 = 1LL * (1LL * Hash2 * base2 % Mod2 + graph[i][j]) % Mod2;
      Hash = 1LL * (1LL * Hash * base % MOD + graph[i][j]) % MOD;
    }
    s.push_back(make_pair(Hash, Hash2));
  }
  sort(s.begin(), s.end()), sort(f.begin(), f.end());
  long long ans = 1LL * check(f) + 1LL * check(s);
  cout << ans << endl;
}
