#include <bits/stdc++.h>
using namespace std;
const int p1 = 17239;
const int q1 = 1e9 + 7;
const int p2 = 115249;
const int q2 = 1791791791;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  unordered_map<int, vector<int>> cnt;
  int n, m;
  long long hh1, hh2, ans = 0;
  ;
  cin >> n >> m;
  set<int> g[n + 1];
  for (int i = 0; i < m; ++i) {
    int u, v;
    cin >> u >> v;
    g[u].insert(v);
    g[v].insert(u);
  }
  for (int it = 1; it <= n; ++it) {
    cnt[g[it].size()].push_back(it);
  }
  for (auto c : cnt) {
    unordered_map<long long, int> mm;
    for (int it : c.second) {
      hh1 = 0;
      hh2 = 0;
      for (int fr : g[it]) {
        hh1 = (hh1 * p1 + fr) % q1;
        hh2 = (hh2 * p2 + fr) % q2;
      }
      ++mm[(hh1 << 32) + hh2];
      g[it].insert(it);
      hh1 = 0;
      hh2 = 0;
      for (int fr : g[it]) {
        hh1 = (hh1 * p1 + fr) % q1;
        hh2 = (hh2 * p2 + fr) % q2;
      }
      ++mm[(hh1 << 32) + hh2];
    }
    for (auto it : mm) {
      ans += 1ll * (it.second - 1) * (it.second) / 2;
    }
  }
  cout << ans;
}
