#include <bits/stdc++.h>
const long long base1 = 131;
const long long base2 = 233;
const long long mod1 = 998244353;
const long long mod2 = 1e9 + 7;
const long long MaxN = 1e6 + 50;
template <class t>
inline void read(t &s) {
  s = 0;
  register long long f = 1;
  register char c = getchar();
  while (!isdigit(c)) {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (isdigit(c)) s = (s << 3) + (s << 1) + (c ^ 48), c = getchar();
  s *= f;
  return;
}
template <class t, class... A>
inline void read(t &x, A &...a) {
  read(x);
  read(a...);
}
template <class t>
inline void write(t x) {
  if (x < 0) putchar('-'), x = -x;
  long long buf[21], top = 0;
  while (x) buf[++top] = x % 10, x /= 10;
  if (!top) buf[++top] = 0;
  while (top) putchar(buf[top--] ^ '0');
  return;
}
inline void setIn(std::string s) {
  freopen(s.c_str(), "r", stdin);
  return;
}
inline void setOut(std::string s) {
  freopen(s.c_str(), "w", stdout);
  return;
}
inline void setIO(std::string s = "") {
  setIn(s + ".in");
  setOut(s + ".out");
  return;
}
template <class t>
inline bool checkmin(t &x, t y) {
  if (x > y) {
    x = y;
    return 1;
  }
  return 0;
}
template <class t>
inline bool checkmax(t &x, t y) {
  if (x < y) {
    x = y;
    return 1;
  }
  return 0;
}
inline long long lowbit(long long x) { return x & (-x); }
std::vector<long long> E[MaxN];
std::pair<long long, long long> f[MaxN];
long long e1[MaxN], e2[MaxN], U[MaxN], V[MaxN];
signed main(void) {
  long long n, m;
  read(n, m);
  register long long u, v, ans = 0;
  for (long long i = 1; i <= m; ++i)
    read(u, v), U[i] = u, V[i] = v, E[u].push_back(v), E[v].push_back(u);
  for (long long i = 1; i <= n; ++i) std::sort((E[i]).begin(), (E[i]).end());
  for (long long i = 1; i <= n; ++i) {
    register long long s1 = 0, s2 = 0;
    for (auto v : E[i])
      s1 = (s1 * base1 + v) % mod1, s2 = (s2 * base2 + v) % mod2;
    f[i] = std::make_pair(s1, s2);
    s1 = 0, s2 = 0;
    E[i].push_back(i), std::sort((E[i]).begin(), (E[i]).end());
    for (auto v : E[i])
      s1 = (s1 * base1 + v) % mod1, s2 = (s2 * base2 + v) % mod2;
    e1[i] = s1, e2[i] = s2;
  }
  std::sort(f + 1, f + n + 1);
  register long long cnt = 0;
  for (long long i = 2; i <= n; ans += cnt, ++i)
    cnt = (f[i] == f[i - 1]) ? (cnt + 1) : 0;
  for (long long i = 1; i <= m; ++i)
    if (e1[U[i]] == e1[V[i]] && e2[U[i]] == e2[V[i]]) ++ans;
  write(ans), std::puts("");
  return 0;
}
