#include <bits/stdc++.h>
using namespace std;
const int MAX = 1000100;
vector<int> adj[MAX];
int id[MAX];
bool compare(int i, int j) { return adj[i] < adj[j]; }
int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  for (int i = 0; i < int(m); i++) {
    int u, v;
    scanf("%d %d", &u, &v);
    u--;
    v--;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  for (int i = 0; i < int(n); i++) id[i] = i;
  for (int i = 0; i < int(n); i++) sort(adj[i].begin(), adj[i].end());
  sort(id, id + n, compare);
  int i, j;
  long long ans = 0;
  i = 0;
  j = 0;
  while (i < n) {
    j = i;
    while (j + 1 < n && adj[id[j + 1]] == adj[id[i]]) j++;
    long long aux = (long long)(j - i + 1);
    ans += (aux * (aux - 1ll)) / 2ll;
    i = j + 1;
  }
  for (int i = 0; i < int(n); i++) {
    adj[i].push_back(i);
    sort(adj[i].begin(), adj[i].end());
  }
  sort(id, id + n, compare);
  i = 0;
  j = 0;
  while (i < n) {
    j = i;
    while (j + 1 < n && adj[id[j + 1]] == adj[id[i]]) j++;
    long long aux = (long long)(j - i + 1);
    ans += (aux * (aux - 1ll)) / 2ll;
    i = j + 1;
  }
  printf("%lld\n", ans);
}
