#include <bits/stdc++.h>
using namespace std;
template <class T, size_t N>
ostream& operator<<(ostream& os, const array<T, N>& v);
template <class T1, class T2>
ostream& operator<<(ostream& os, const pair<T1, T2>& p) {
  return os << "(" << p.first << ", " << p.second << ")";
}
template <class T>
ostream& operator<<(ostream& os, const vector<T>& v) {
  bool f = 1;
  os << "[";
  for (auto& i : v) {
    if (!f) os << ", ";
    os << i;
    f = 0;
  }
  return os << "]";
}
template <class T, size_t N>
ostream& operator<<(ostream& os, const array<T, N>& v) {
  bool f = 1;
  os << "[";
  for (auto& i : v) {
    if (!f) os << ", ";
    os << i;
    f = 0;
  }
  return os << "]";
}
template <class T1, class T2>
ostream& operator<<(ostream& os, const set<T1, T2>& v) {
  bool f = 1;
  os << "[";
  for (auto& i : v) {
    if (!f) os << ", ";
    os << i;
    f = 0;
  }
  return os << "]";
}
template <class T1, class T2>
ostream& operator<<(ostream& os, const multiset<T1, T2>& v) {
  bool f = 1;
  os << "[";
  for (auto& i : v) {
    if (!f) os << ", ";
    os << i;
    f = 0;
  }
  return os << "]";
}
template <class T1, class T2, class T3>
ostream& operator<<(ostream& os, const map<T1, T2, T3>& v) {
  bool f = 1;
  os << "[";
  for (auto& ii : v) {
    if (!f) os << ", ";
    os << "(" << ii.first << " -> " << ii.second << ") ";
    f = 0;
  }
  return os << "]";
}
template <class T1, class T2>
ostream& operator<<(ostream& os, const multimap<T1, T2>& v) {
  bool f = 1;
  os << "[";
  for (auto& ii : v) {
    if (!f) os << ", ";
    os << "(" << ii.first << " -> " << ii.second << ") ";
    f = 0;
  }
  return os << "]";
}
template <class T1, class T2>
ostream& operator<<(ostream& os, priority_queue<T1, T2> v) {
  bool f = 1;
  os << "[";
  while (!v.empty()) {
    auto x = v.top();
    v.pop();
    if (!f) os << ", ";
    f = 0;
    os << x;
  }
  return os << "]";
}
template <class T1, class T2>
void printarray(const T1& a, T2 sz, T2 beg = 0) {
  for (T2 i = beg; i < sz; i++) cout << a[i] << " ";
  cout << endl;
}
long long P1 = 1000006583, Q1 = 1000006901, P2 = 1000005053, Q2 = 1000005317;
pair<long long, long long> operator+(pair<long long, long long> a,
                                     pair<long long, long long> b) {
  pair<long long, long long> res = {a.first + b.first, a.second + b.second};
  if (res.first > Q1) res.first -= Q1;
  if (res.second > Q2) res.second -= Q2;
  return res;
}
pair<long long, long long> operator-(pair<long long, long long> a,
                                     pair<long long, long long> b) {
  pair<long long, long long> res = {a.first - b.first, a.second - b.second};
  if (res.first < 0) res.first += Q1;
  if (res.second < 0) res.second += Q2;
  return res;
}
int N, M;
long long ppow1[1000500], ppow2[1000500];
vector<int> E[1005000];
pair<long long, long long> H[1000500];
int main() {
  ppow1[0] = ppow2[0] = 1;
  for (int i = 1; i <= 1000000; i++) {
    ppow1[i] = (ppow1[i - 1] * P1) % Q1;
    ppow2[i] = (ppow2[i - 1] * P2) % Q2;
  }
  scanf("%d%d", &N, &M);
  vector<pair<int, int> > elist;
  for (int i = 1; i <= M; i++) {
    int a, b;
    scanf("%d%d", &a, &b);
    E[a].push_back(b);
    E[b].push_back(a);
    elist.push_back({a, b});
  }
  long long ans = 0;
  map<pair<long long, long long>, long long> mp;
  for (int i = 1; i <= N; i++) {
    pair<long long, long long> h = {0, 0};
    for (auto e : E[i]) {
      h = h + make_pair(ppow1[e], ppow2[e]);
    }
    H[i] = h;
    mp[h]++;
  }
  for (auto e : mp) {
    ans += (e.second - 1) * e.second / 2;
  }
  for (auto e : elist) {
    int a = e.first, b = e.second;
    pair<long long, long long> ha = H[a], hb = H[b];
    ha = ha - make_pair(ppow1[b], ppow2[b]);
    hb = hb - make_pair(ppow1[a], ppow2[a]);
    if (ha == hb) ans++;
  }
  printf("%lld\n", ans);
}
