#include <bits/stdc++.h>
using namespace std;
long long n, m;
const long long N = 1e6 + 1e5;
long long Res;
long long p[N], h[N], a[N], b[N];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  long long n, m;
  cin >> n >> m;
  p[0] = 1;
  for (long long i = 1; i <= n; i++) p[i] = p[i - 1] * 3;
  for (long long i = 1; i <= m; i++) {
    cin >> a[i] >> b[i];
    h[a[i]] += p[b[i]];
    h[b[i]] += p[a[i]];
  }
  for (long long i = 1; i <= m; i++) {
    if (h[a[i]] + p[a[i]] == h[b[i]] + p[b[i]]) Res++;
  }
  sort(h + 1, h + 1 + n);
  for (long long i = 1; i <= n; i++) {
    long long j = i;
    while (j <= n && h[i] == h[j]) j++;
    Res += (j - i) * (j - i - 1) / 2;
    i = j - 1;
  }
  cout << Res;
}
