#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("-O2")
const int LIM = 5e5 + 5;
const int MOD1 = 1e9 + 7, MOD2 = 1e9 + 9, p = 1e6 + 33;
int t, n, m, k, x, y;
vector<vector<int> > v;
unordered_map<long long, long long> M;
vector<vector<long long> > A1, A2;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  srand(time(0));
  long long rad = rand() * rand();
  cin >> n >> m;
  v.assign(n, vector<int>());
  A1.assign(n, vector<long long>());
  A2.assign(n, vector<long long>());
  long long in1 = 390901103, in2 = 224303600;
  long long arr1[n + 1], arr2[n + 1], hash1[n + 1], hash2[n + 1];
  arr1[0] = arr2[0] = 1;
  for (int i = 1; i < n + 1; i++) {
    arr1[i] = (p * arr1[i - 1]) % MOD1;
    arr2[i] = (p * arr2[i - 1]) % MOD2;
  }
  for (int i = 0; i < m; i++) {
    cin >> x >> y;
    x--;
    y--;
    v[x].push_back(y);
    v[y].push_back(x);
  }
  for (int i = 0; i < n; i++) {
    sort(v[i].begin(), v[i].end());
    long long h1 = 0, h2 = 0;
    int x = 0;
    for (auto &it : v[i]) {
      h1 = (h1 + ((1 + it) * arr1[x++])) % MOD1;
      h2 = (h2 + ((1 + it) * arr2[x - 1])) % MOD2;
      A1[i].push_back(h1);
      A2[i].push_back(h2);
    }
    hash1[i] = h1;
    hash2[i] = h2;
    M[(h1 * h2) ^ rad]++;
  }
  long long ans = 0;
  for (auto &it : M) ans += (it.second * (it.second - 1));
  for (int i = 0; i < n; i++) {
    x = 0;
    for (auto &it : v[i]) {
      if (hash1[it] == hash1[i] && hash2[it] == hash2[i]) ans--;
      int J = lower_bound(v[it].begin(), v[it].end(), i) - v[it].begin();
      long long val11 = ((x == 0) ? 0 : A1[i][x - 1]);
      long long val12 = ((x == 0) ? 0 : A2[i][x - 1]);
      long long val21 = ((J == 0) ? 0 : A1[it][J - 1]);
      long long val22 = ((J == 0) ? 0 : A2[it][J - 1]);
      val11 = (val11 + (in1 * (hash1[i] - A1[i][x])));
      val12 = (val12 + (in2 * (hash2[i] - A2[i][x])));
      val21 = (val21 + (in1 * (hash1[it] - A1[it][J])));
      val22 = (val22 + (in2 * (hash2[it] - A2[it][J])));
      if ((val11 - val21) % MOD1 == 0 && (val12 - val22) % MOD2 == 0) ans++;
      x++;
    }
  }
  cout << ans / 2 << "\n";
  return 0;
}
