#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 7;
vector<int> adj[N], adj1[N];
int main() {
  ios_base ::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, m;
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    int u, v;
    cin >> u >> v;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  for (int i = 1; i <= n; i++) {
    adj1[i] = adj[i];
    adj1[i].push_back(i);
    sort(adj[i].begin(), adj[i].end());
    sort(adj1[i].begin(), adj1[i].end());
  }
  adj[n + 1].push_back(-1);
  adj1[n + 1].push_back(-1);
  sort(adj + 1, adj + n + 1);
  sort(adj1 + 1, adj1 + n + 1);
  long long ans = 0, cnt = 0;
  for (int i = 1; i <= n + 1; i++) {
    if (adj[i] == adj[i - 1]) {
      ++cnt;
    } else {
      ans += cnt * (cnt - 1) / 2;
      cnt = 1;
    }
  }
  cnt = 0;
  for (int i = 1; i <= n + 1; i++) {
    if (adj1[i] == adj1[i - 1]) {
      ++cnt;
    } else {
      ans += cnt * (cnt - 1) / 2;
      cnt = 1;
    }
  }
  cout << ans << endl;
}
