#include <bits/stdc++.h>
using namespace std;
int a[1000005], b[1000005];
long long h[1000005], s[1000005];
map<long long, long long> f;
void add(int a, int b) { s[a] += h[b]; }
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  h[0] = 1;
  for (int i = (1); i <= (n); i++) h[i] = h[i - 1] * 9991ll;
  for (int i = (1); i <= (m); i++) {
    scanf("%d%d", a + i, b + i);
    add(a[i], b[i]);
    add(b[i], a[i]);
  };
  long long ans = 0;
  for (int i = (1); i <= (n); i++) ans += (f[s[i]]++);
  for (int i = (1); i <= (m); i++)
    ans += (s[a[i]] - h[b[i]]) == (s[b[i]] - h[a[i]]);
  cout << ans << endl;
  return 0;
}
