#include <bits/stdc++.h>
using namespace std;
long long prime;
int n, m;
vector<int> graph[1000005];
map<pair<long long, long long>, long long> mp;
void compute_hash(int i) {
  int n = graph[i].size();
  long long h = 0, hh = 0;
  for (int j = 0; j < n; j++) {
    h = ((h * prime) % 1000000007 + graph[i][j]) % 1000000007;
    hh = ((hh * prime) % 1000000009 + graph[i][j]) % 1000000009;
  }
  mp[{h, hh}]++;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  cin >> n >> m;
  prime = 1299709;
  for (int i = 0; i < m; i++) {
    int x, y;
    cin >> x >> y;
    graph[x].push_back(y);
    graph[y].push_back(x);
  }
  for (int i = 1; i <= n; i++) {
    sort(graph[i].begin(), graph[i].end());
    compute_hash(i);
  }
  long long ans = 0;
  for (auto h : mp) {
    long long cnt = h.second;
    ans += (cnt * (cnt - 1)) / 2;
  }
  mp.clear();
  for (int i = 1; i <= n; i++) {
    graph[i].push_back(i);
    sort(graph[i].begin(), graph[i].end());
    compute_hash(i);
  }
  for (auto h : mp) {
    long long cnt = h.second;
    ans += (cnt * (cnt - 1)) / 2;
  }
  cout << ans << '\n';
  return 0;
}
