#include <bits/stdc++.h>
using namespace std;
const int N = 1000009;
long long v[N], h1[N], h2[N], ans;
int n, m;
int main() {
  v[0] = v[1] = 1;
  for (int i = 2; i <= N; ++i) v[i] = v[i - 1] * 3;
  while (cin >> n >> m) {
    memset(h1, 0, sizeof(h1));
    for (int i = 0, a, b; i < m; ++i) {
      cin >> a >> b;
      h1[a] += v[b];
      h1[b] += v[a];
    }
    memset(h2, 0, sizeof(h2));
    for (int i = 1; i <= n; ++i) h2[i] = h1[i] + v[i];
    sort(h1 + 1, h1 + n + 1);
    long long cnt = 0, num = -1;
    for (int i = 1; i <= n; ++i) {
      if (h1[i] == num)
        cnt++, ans += cnt;
      else {
        cnt = 0;
        num = h1[i];
      }
    }
    sort(h2 + 1, h2 + n + 1);
    cnt = 0;
    num = -1;
    for (int i = 1; i <= n; ++i) {
      if (h2[i] == num)
        cnt++, ans += cnt;
      else {
        cnt = 0;
        num = h2[i];
      }
    }
    cout << ans << endl;
  }
  return 0;
}
