#include <bits/stdc++.h>
using namespace std;
vector<long long> a, b;
long long st[1000000];
int n, m;
long long x, y, res;
long long p = 1000000000000009;
int main() {
  cin >> n >> m;
  a.resize(n, 0);
  st[0] = 1;
  a[0] = 1;
  for (int i = 1; i < n; i++) {
    st[i] = (2 * st[i - 1]) % p;
    a[i] = st[i];
  }
  for (int i = 0; i < m; i++) {
    cin >> x >> y;
    x--;
    y--;
    a[x] += st[y];
    a[x] = a[x] % p;
    a[y] += st[x];
    a[y] = a[y] % p;
  }
  b = a;
  for (int i = 0; i < n; i++) {
    b[i] = (b[i] - st[i] + p) % p;
  }
  y = 0;
  sort(b.begin(), b.end());
  for (int i = 0; i < b.size(); i++) {
    if (i && b[i] != b[i - 1]) {
      res += y * (y - 1) / 2;
      y = 1;
    }
    if (!i || b[i] == b[i - 1]) y++;
  }
  res += y * (y - 1) / 2;
  y = 0;
  sort(a.begin(), a.end());
  for (int i = 0; i < a.size(); i++) {
    if (i && a[i] != a[i - 1]) {
      res += y * (y - 1) / 2;
      y = 1;
    }
    if (!i || a[i] == a[i - 1]) y++;
  }
  res += y * (y - 1) / 2;
  y = 0;
  cout << res;
}
