#include <bits/stdc++.h>
using namespace std;
int n, m;
long long hashing[1000001];
vector<int> friends[1000001];
long long compute_hash(vector<int> a) {
  const long long p = 1e9 + 7;
  long long value = 0, pow = 1;
  for (int i = 0; i < a.size(); i++) {
    value += a[i] * pow;
    pow *= p;
  }
  return value;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int a, b;
  long long ans = 0;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    cin >> a >> b;
    friends[a].push_back(b);
    friends[b].push_back(a);
  }
  for (int i = 1; i <= n; i++) {
    sort(friends[i].begin(), friends[i].end());
    hashing[i] = compute_hash(friends[i]);
  }
  sort(hashing + 1, hashing + n + 1);
  int i = 1;
  while (i <= n) {
    int cnt = 0;
    while (i + cnt <= n && hashing[i] == hashing[i + cnt]) cnt++;
    i = i + cnt;
    ans += ((long long)cnt * (long long)(cnt - 1)) / 2;
  }
  for (int i = 1; i <= n; i++) {
    friends[i].push_back(i);
    sort(friends[i].begin(), friends[i].end());
    hashing[i] = compute_hash(friends[i]);
  }
  sort(hashing + 1, hashing + n + 1);
  i = 1;
  while (i <= n) {
    int cnt = 1;
    while (i + cnt <= n && hashing[i] == hashing[i + cnt]) cnt++;
    i = i + cnt;
    ans += ((long long)cnt * (long long)(cnt - 1)) / 2;
  }
  cout << ans << "\n";
  return 0;
}
