#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e6 + 10;
long long id[MAXN], hsh[2][MAXN];
vector<int> edges[MAXN];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  mt19937_64 mt(time(0));
  int n, m, a, b;
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    id[i] = mt();
  }
  for (int i = 0; i < m; i++) {
    cin >> a >> b;
    edges[a].push_back(b);
    edges[b].push_back(a);
  }
  for (int i = 1; i <= n; i++) {
    sort(edges[i].begin(), edges[i].end(), greater<int>());
    for (int j : edges[i]) {
      hsh[0][i] ^= id[j];
      hsh[1][i] ^= (id[j] * id[j]);
    }
  }
  long long ret = 0;
  map<pair<long long, long long>, int> table;
  for (int i = n; i >= 1; i--) {
    for (int j : edges[i]) {
      if (j < i) break;
      long long x = hsh[0][j] ^ id[i];
      long long y = hsh[0][i] ^ id[j];
      if (x != y) continue;
      x = hsh[1][j] ^ (id[i] * id[i]);
      y = hsh[1][i] ^ (id[j] * id[j]);
      if (x == y) ret++;
    }
    auto it = table.find({hsh[0][i], hsh[1][i]});
    if (it != table.end()) {
      ret += it->second;
      it->second++;
    } else
      table[{hsh[0][i], hsh[1][i]}]++;
  }
  cout << ret << endl;
}
