#include <bits/stdc++.h>
using namespace std;
const long long MAX = 2e6 + 100;
vector<long long> adj[MAX];
map<pair<long long, long long>, long long> h;
pair<long long, long long> twohashing(vector<long long> s,
                                      long long m1 = 1e9 + 7,
                                      long long m2 = 1e9 + 33, long long p = 31,
                                      long long q = 43) {
  long long hash1 = 0, hash2 = 0, pow_p = 1, pow_q = 1;
  for (long long i = 0; i < (long long)s.size(); i++) {
    (hash1 += pow_p * (s[i] + 1)) %= m1;
    (hash2 += pow_q * (s[i] + 1)) %= m2;
    (pow_p *= p) %= m1;
    (pow_q *= q) %= m2;
  }
  return {hash1, hash2};
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n, m, a, b;
  cin >> n >> m;
  for (long long i = 0; i < (long long)m; i++) {
    cin >> a >> b;
    adj[a].push_back(b);
    adj[b].push_back(a);
  }
  for (long long i = 1; i < (long long)n + 1; i++) {
    adj[n + i] = adj[i];
    adj[n + i].push_back(i);
  }
  for (long long i = 1; i < (long long)2 * n + 1; i++)
    sort(adj[i].begin(), adj[i].end());
  for (long long i = 1; i < (long long)2 * n + 1; i++) h[twohashing(adj[i])]++;
  long long ans = 0;
  for (auto it : h) {
    long long x = it.second;
    ans += (x * (x - 1)) / 2;
  }
  cout << ans << endl;
  return 0;
}
