#include <bits/stdc++.h>
using namespace std;
int n, m, a, b;
pair<int, int> p[1000006];
pair<int, int> H[1000006];
vector<int> v[1000006];
map<pair<int, int>, int> M;
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    cin >> a >> b;
    v[a].push_back(b);
    v[b].push_back(a);
  }
  p[0] = {1, 1};
  for (int i = 1; i <= n; i++) {
    p[i].first = 1LL * p[i - 1].first * 5 % 1000000007;
    p[i].second = 1LL * p[i - 1].second * 5 % 31183;
  }
  for (int i = 1; i <= n; i++) {
    for (auto it : v[i]) {
      H[i].first = (H[i].first + p[it].first) % 1000000007;
      H[i].second = (H[i].second + p[it].second) % 31183;
    }
    M[{H[i].first, H[i].second}]++;
  }
  long long ans = 0;
  for (auto it : M) {
    ans = ans + 1LL * it.second * (it.second - 1) / 2;
  }
  for (int i = 1; i <= n; i++) {
    for (auto it : v[i]) {
      if (i >= it) continue;
      pair<int, int> a, b;
      a.first = (H[it].first - p[i].first + 1000000007) % 1000000007;
      a.second = (H[it].second - p[i].second + 31183) % 31183;
      b.first = (H[i].first - p[it].first + 1000000007) % 1000000007;
      b.second = (H[i].second - p[it].second + 31183) % 31183;
      if (a == b) ans++;
    }
  }
  cout << ans << '\n';
  return 0;
}
