#include <bits/stdc++.h>
const int N = 1001 * 1001;
using namespace std;
vector<int> g[N];
vector<vector<int>> vals;
int n, m;
int main() {
  ios_base::sync_with_stdio(0);
  cout.tie(0);
  cin.tie(0);
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    int u, v;
    cin >> u >> v;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  for (int i = 1; i <= n; i++) {
    sort(g[i].begin(), g[i].end());
    vals.push_back(g[i]);
    vector<int> cur = g[i];
    cur.push_back(i);
    sort(cur.begin(), cur.end());
    vals.push_back(cur);
  }
  long long ans = 0, cur = 0;
  vector<int> prev = {-1};
  sort(vals.begin(), vals.end());
  vals.push_back({-2});
  for (auto el : vals) {
    if (el != prev) {
      ans += cur * (cur - 1) / 2;
      cur = 1;
    } else {
      cur++;
    }
    prev = el;
  }
  cout << ans << '\n';
  return 0;
}
