#include <bits/stdc++.h>
using namespace std;
long long calc_hash(vector<long long> &arr, long long prime) {
  long long power = 1, res = 0;
  for (auto num : arr)
    res = (res * prime % 1000000007 + num) % 1000000007,
    power = power * prime % 1000000007;
  return res;
}
pair<long long, long long> double_hash(vector<long long> &arr,
                                       long long prime_1, long long prime_2) {
  sort(arr.begin(), arr.end());
  long long hash_1 = calc_hash(arr, prime_1);
  long long hash_2 = calc_hash(arr, prime_2);
  return make_pair(hash_1, hash_2);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  long long n, m;
  cin >> n >> m;
  vector<vector<long long>> arr(n + 1);
  for (int i = 0; i < m; i++) {
    int u, v;
    cin >> u >> v;
    arr[u].push_back(v);
    arr[v].push_back(u);
  }
  map<pair<long long, long long>, long long> cnt;
  for (int i = 1; i <= n; i++) {
    auto p = double_hash(arr[i], 1000033, 1000037);
    if (cnt.count(p) > 0)
      ++cnt[p];
    else
      cnt[p] = 1;
    arr[i].push_back(i);
    p = double_hash(arr[i], 1000033, 1000037);
    if (cnt.count(p) > 0)
      ++cnt[p];
    else
      cnt[p] = 1;
  }
  long long res = 0;
  for (auto item : cnt) res += item.second * (item.second - 1) / 2;
  cout << res << endl;
  return 0;
}
