#include <bits/stdc++.h>
using namespace std;
template <class T>
T MAX(T a, T b) {
  return a > b ? a : b;
}
template <class T>
T MIN(T a, T b) {
  return a < b ? a : b;
}
template <class T1>
void __(T1 p) {
  cout << p << endl;
}
template <class T1>
void deb(T1 p) {
  cout << "Debugging: " << p << endl;
}
template <class T1, class T2>
void deb(T1 p, T2 q) {
  cout << "Debugging: " << p << "\t" << q << endl;
}
template <class T1, class T2, class T3>
void deb(T1 p, T2 q, T3 r) {
  cout << "Debugging: " << p << "\t " << q << "\t " << r << endl;
}
template <class T1, class T2, class T3, class T4>
void deb(T1 p, T2 q, T3 r, T4 s) {
  cout << "Debugging: " << p << "\t " << q << "\t " << r << "\t " << s << endl;
}
long long int POOW(long long b, long long p) {
  if (p == 0) return 1;
  return b * POOW(b, p - 1);
}
bool CHK(int mask, int pos) { return (1 & (mask >> pos)); }
const int first[] = {0, 0, 1, -1, -1, 1, -1, 1};
const int second[] = {1, -1, 0, 0, 1, 1, -1, -1};
const int kx[] = {-2, -1, 1, 2, 2, 1, -1, -2};
const int ky[] = {1, 2, 2, 1, -1, -2, -2, -1};
int n, m;
vector<int> v[1000006];
map<unsigned long long, int> mp;
unsigned long long hashh[1000006];
unsigned long long aa[1000006];
long long DD(int n) {
  long long a = n;
  return (a * (a - 1)) / 2;
}
int main() {
  int i, t, j, k, l, keis(0), c, d, x, y, a, b;
  scanf("%d", &n);
  scanf("%d", &m);
  memset(aa, 0x00, sizeof aa);
  hashh[0] = 1;
  pair<int, int> mm[1000006];
  for (i = 1; i <= n; i++) {
    if (i & 1)
      hashh[i] = hashh[i - 1] * 3;
    else
      hashh[i] = hashh[i - 1] * 7;
  }
  for (i = 0; i < m; i++) {
    scanf("%d", &a);
    scanf("%d", &b);
    aa[a] += hashh[b];
    aa[b] += hashh[a];
    mm[i] = {a, b};
  }
  for (i = 1; i <= n; i++) {
    mp[aa[i]]++;
  }
  long long p = 0;
  for (auto u : mp) {
    p += DD(u.second);
  }
  for (i = 0; i < m; i++) {
    if (aa[mm[i].first] + hashh[mm[i].first] ==
        hashh[mm[i].second] + aa[mm[i].second])
      p++;
  }
  __(p);
  return 0;
}
