#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:256000000")
using namespace std;
const double PI = 3.1415926535897932384626433832795;
const string IN_NAME = "input.txt";
const string OUT_NAME = "output.txt";
template <class T>
T sqr(const T &x) {
  return x * x;
}
const double eps = 1e-12;
int n, m;
int pm1[1234567];
int pm2[1234567];
int m1 = 1000000007;
int m2 = 1000000009;
pair<long long, long long> h[1234567];
vector<pair<long long, long long> > hs;
int x, y;
vector<pair<int, int> > es;
int main() {
  cin >> n >> m;
  pm1[0] = pm2[0] = 1;
  for (int i = 1; i < 1234567; i++) {
    pm1[i] = pm1[i - 1] * m1;
    pm2[i] = pm2[i - 1] * m2;
  }
  for (int i = 0; i < m; i++) {
    scanf("%d%d", &x, &y);
    --x;
    --y;
    es.push_back(pair<int, int>(x, y));
    h[x].first += pm1[y];
    h[x].second += pm2[y];
    h[y].first += pm1[x];
    h[y].second += pm2[x];
  }
  long long res = 0;
  for (int i = 0; i < n; i++) {
    hs.push_back(h[i]);
  }
  sort((hs).begin(), (hs).end());
  pair<long long, long long> last = hs[0];
  long long cnt = 1;
  for (int i = 1; i < n; i++) {
    if (hs[i] == last)
      ++cnt;
    else {
      res += (cnt * (cnt - 1) / 2);
      cnt = 1;
      last = hs[i];
    }
  }
  res += (cnt * (cnt - 1) / 2);
  for (int i = 0; i < m; i++) {
    x = es[i].first;
    y = es[i].second;
    pair<long long, long long> hx = h[x];
    pair<long long, long long> hy = h[y];
    hx.first -= pm1[y];
    hx.second -= pm2[y];
    hy.first -= pm1[x];
    hy.second -= pm2[x];
    if (hx == hy) ++res;
  }
  cout << res;
}
