#include <bits/stdc++.h>
using namespace std;
const int P1 = 1000081;
const int maxn = 1001000;
long long stp1[maxn];
int n, m;
vector<int> a[maxn];
vector<vector<long long> > H1;
vector<long long> M;
long long calc(int i, int j) {
  return H1[i - 1][0] + (H1[i - 1][j + 1] - H1[i - 1][j]) * stp1[j];
}
int main() {
  stp1[0] = 1;
  for (int i = 1; i < maxn; i++) {
    stp1[i] = stp1[i - 1] * P1;
  }
  scanf("%d %d", &n, &m);
  for (int i = 0; i < m; i++) {
    int x, y;
    scanf("%d %d", &x, &y);
    a[x].push_back(y);
    a[y].push_back(x);
  }
  H1.reserve(n);
  for (int i = 1; i <= n; i++) {
    sort((a[i]).begin(), (a[i]).end());
    a[i].resize(unique((a[i]).begin(), (a[i]).end()) - a[i].begin());
    vector<long long> h1((int)(a[i]).size() + 1, 0);
    for (int j = (int)(a[i]).size() - 1; j >= 0; j--) {
      h1[j] = h1[j + 1] * P1 + a[i][j];
    }
    M.push_back(h1[0]);
    H1.push_back(h1);
  }
  sort((M).begin(), (M).end());
  long long ans = 0;
  int pr = -1;
  for (int i = 0; i < (int)(M).size(); i++) {
    if (i == (int)(M).size() - 1 || M[i] != M[i + 1]) {
      int k = i - pr;
      ans += ((long long)k * (k - 1)) / 2;
      pr = i;
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j < (int)(a[i]).size(); j++) {
      if (i < a[i][j]) {
        if (calc(i, j) == calc(a[i][j], lower_bound((a[a[i][j]]).begin(),
                                                    (a[a[i][j]]).end(), i) -
                                            a[a[i][j]].begin())) {
          ans++;
        }
      }
    }
  }
  cout << ans << endl;
  return 0;
}
