#include <bits/stdc++.h>
using namespace std;
long long int h1[1000005], h2[1000005];
long long int p = 23333;
int n, m;
void init() {
  h2[0] = 1;
  for (int i = 1; i <= n; i++) {
    h2[i] = h2[i - 1] * p;
  }
}
long long int solve(long long int* h) {
  sort(h + 1, h + n + 1);
  long long int cnt = 0, ans = 0;
  for (int i = 2; i <= n; i++) {
    if (h[i] == h[i - 1])
      ans += ++cnt;
    else
      cnt = 0;
  }
  return ans;
}
int main() {
  cin >> n >> m;
  init();
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    h1[a] += h2[b];
    h1[b] += h2[a];
  }
  for (int i = 1; i <= n; i++) h2[i] += h1[i];
  cout << solve(h1) + solve(h2) << endl;
  return 0;
}
