#include <bits/stdc++.h>
using namespace std;
int n, m, i, j, x, y, a, b, k;
vector<int> g[1000100];
int main() {
  vector<pair<int, int> > v;
  cin >> n >> m;
  for (i = 0; i < m; ++i) {
    scanf("%d %d", &x, &y);
    g[x].push_back(y);
    g[y].push_back(x);
  }
  a = 10007;
  b = 1000003;
  for (i = 1; i <= n; ++i) {
    sort(g[i].begin(), g[i].end());
    pair<int, int> hsh;
    hsh.first = 0;
    hsh.second = 0;
    for (j = 0; j < g[i].size(); ++j) {
      hsh.first *= a;
      hsh.second *= b;
      hsh.first += g[i][j];
      hsh.second += g[i][j];
    }
    v.push_back(hsh);
    g[i].push_back(i);
    sort(g[i].begin(), g[i].end());
    hsh.first = 0;
    hsh.second = 0;
    for (j = 0; j < g[i].size(); ++j) {
      hsh.first *= a;
      hsh.second *= b;
      hsh.first += g[i][j];
      hsh.second += g[i][j];
    }
    v.push_back(hsh);
  }
  long long ans = 0;
  sort(v.begin(), v.end());
  k = 1;
  for (i = 1; i < v.size(); ++i) {
    if (v[i - 1] == v[i])
      k++;
    else {
      ans += (k * 1LL * (k - 1)) / 2;
      k = 1;
    }
  }
  ans += (k * 1LL * (k - 1)) / 2;
  cout << ans;
  return 0;
}
