#include <bits/stdc++.h>
using namespace std;
const int N = 1000006;
const long long int M = 935172938408392767LL;
vector<long long int> kub[N];
long long int kra[N];
long long int maska[N];
int deg[N];
int main() {
  int n, m, a, b;
  long long int wynik = 0;
  scanf("%d%d", &n, &m);
  kra[1] = 1;
  for (int i = 2; i <= n; i++) kra[i] = (kra[i - 1] * 2) % M;
  for (int i = 0; i < m; i++) {
    scanf("%d%d", &a, &b);
    maska[a] += kra[b];
    maska[b] += kra[a];
    maska[a] %= M;
    maska[b] %= M;
    deg[a]++;
    deg[b]++;
  }
  for (int i = 1; i <= n; i++) {
    kub[deg[i]].push_back(maska[i]);
    kub[deg[i]].push_back((maska[i] + kra[i]) % M);
  }
  for (int i = 0; i <= n; i++) {
    sort(kub[i].begin(), kub[i].end());
    a = 1;
    for (int j = 1; j < kub[i].size(); j++) {
      if (kub[i][j - 1] == kub[i][j])
        a++;
      else {
        wynik += ((a - 1) * (long long)a) / 2;
        a = 1;
      }
    }
    wynik += ((a - 1) * (long long)a) / 2;
  }
  printf("%I64d\n", wynik);
  return 0;
}
