#include<bits/stdc++.h>
using namespace std;
int main()
{
     long long n;
     cin>>n;
     vector<long long >v(n);
     vector<long long >p;
     for(long long i=0;i<n;i++)
     cin>>v[i];
     long double  sum=0;
     long long count=0;
     for(long long i=0;i<n;i++)
     {
          sum=sum+v[i];
     }
     for(long long j=0;j<n;j++){
          long double  mean=(sum-v[j])/(n-1);
          if(mean==v[j])
          {

              count++;
              p.push_back(j+1);

          }

       }
       if(count)
       {
            cout<<count<<endl;
            for(long long i=0;i<p.size();i++)
            cout<<p[i]<<" ";

       }
            else
            cout<<"0"<<endl;
     return 0;

}


#include<bits/stdc++.h>
using namespace std;
int main()
{
     long long n;
     cin>>n;
     vector<long long >v(n);
     vector<long long >p;
     for(long long i=0;i<n;i++)
     cin>>v[i];
     long long  sum=0;
     long long count=0;
     for(long long i=0;i<n;i++)
     {
          sum=sum+v[i];
     }
     for(long long j=0;j<n;j++){
          long long  mean=(sum-v[j])/(n-1);
          if(mean==v[j])
          {

              count++;
              p.push_back(j+1);

          }

       }
       if(count)
       {
            cout<<count<<endl;
            for(long long i=0;i<p.size();i++)
            cout<<p[i]<<" ";

       }
            else
            cout<<"0"<<endl;
     return 0;

}


#include<bits/stdc++.h>
using namespace std;
int main()
{
     int n;
     cin>>n;
     vector<int>v(n);
     vector<int>p;
     for(int i=0;i<n;i++)
     cin>>v[i];
     int sum=0;
     int count=0;
     for(int i=0;i<n;i++)
     {
          sum=sum+v[i];
     }
     for(int j=0;j<n;j++){
          int mean=(sum-v[j])/(n-1);
          if(mean==v[j])
          {

              count++;
              p.push_back(j+1);

          }

       }
       if(count)
       {
            cout<<count<<endl;
            for(int i=0;i<p.size();i++)
            cout<<p[i]<<" ";

       }
            else
            cout<<"-1"<<endl;
     return 0;

}


#include<bits/stdc++.h>
using namespace std;
int main()
{
     int n;
     cin>>n;
     vector<int>v(n);
     vector<int>p;
     for(int i=0;i<n;i++)
     cin>>v[i];
     int sum=0;
     int count=0;
     for(int i=0;i<n;i++)
     {
          sum=sum+v[i];
     }
     for(int j=0;j<n;j++){
          int mean=(sum-v[j])/(n-1);
          if(mean==v[j])
          {

              count++;
              p.push_back(j+1);

          }

       }
       if(count)
       {
            cout<<count<<endl;
            for(int i=0;i<p.size();i++)
            cout<<p[i]<<" ";

       }
            else
            cout<<"0"<<endl;
     return 0;

}


#include <bits/stdc++.h>
using namespace std;
int n, sum, a[20005];
vector<int> v;
int main(){
    cin >> n;
    for(int i = 0; i < n; i++){
        scanf("%d",&a[i]);
        sum += a[i];
    }
    for(int i = 0; i < n; i++){
        if((a[i] * n) == sum){
            v.push_back(i+1);
        }
    }
    cout << v.size() << endl;
    for(auto x : v){
        printf("%d ", x);
    }
    cout << endl;
}


#include <bits/stdc++.h>
using namespace std;
int n, sum, a[200005];
vector<int> v;
int main(){
    cin >> n;
    for(int i = 0; i < n; i++){
        scanf("%d",&a[i]);
        sum += a[i];
    }
    for(int i = 0; i < n; i++){
        if((a[i] * n) == sum){
            v.push_back(i+1);
        }
    }
    cout << v.size() << endl;
    for(auto x : v){
        printf("%d ", x);
    }
    cout << endl;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define vi vector<int>
#define vll vector<ll>
#define ii pair<int, int>
#define vii vector<ii>
#define vvi vector<vi>
#define vvii vector<vii>
#define ld long double
#define iii tuple<int, int, int>
#define sc scanf
#define pb push_back

int a[200005];

int main() {

    int n;
    sc("%d", &n);

    int sum = 0;

    for(int i=1; i<=n; ++i) {
        sc("%d", &a[i]);

        sum += a[i];
    }

    vi ans;

    for(int i=1; i<=n; ++i) {
        if((sum - a[i])%(n-1) == 0 && (sum - a[i])/(n-1) == a[i]) {
            ans.pb(i);
        }
    }

    printf("%d\n", (int)ans.size());

    for(auto p: ans) {
        printf("%d\n", p);
    }
}


#include <iostream>
using namespace std;
int main()
{
	int n, i, t, d, j;
	int m[200000], k[1000];
	cin >> n;
	t = 0;
	d = 0;
	j = 0;
	for (i = 1; i <= n; i++)
	{
		cin >> m[i];
		t += m[i];
	}
	t = t / n;
	for (i = 1; i <= n; i++)
	{
		if (m[i] == t)
		{
			j = j + 1;
			k[j] = i;
			d++;
		}
	}
	cout << d << endl;
	for (i = 1; i <= j; i++)
		if (i == j) cout << k[i];
		else cout << k[i] << " ";
	return 0;
}


#include <iostream>
using namespace std;
int main()
{
	int n, i, t, d, j;
	int m[200001], k[1000];
	cin >> n;
	t = 0;
	d = 0;
	j = 0;
	for (i = 1; i <= n; i++)
	{
		cin >> m[i];
		t += m[i];
	}
	for (i = 1; i <= n; i++)
	{
		if (m[i] * n == t)
		{
			j = j + 1;
			k[j] = i;
			d++;
		}
	}
	cout << d << endl;
	for (i = 1; i <= j; i++)
		if (i == j) cout << k[i];
		else cout << k[i] << " ";
	return 0;
}


#include <iostream>
using namespace std;
int main()
{
	int n, i, t, d, j;
	int m[200001], k[1000];
	cin >> n;
	t = 0;
	d = 0;
	j = 0;
	for (i = 1; i <= n; i++)
	{
		cin >> m[i];
		t += m[i];
	}
	t = t / n;
	for (i = 1; i <= n; i++)
	{
		if (m[i] == t)
		{
			j = j + 1;
			k[j] = i;
			d++;
		}
	}
	cout << d << endl;
	for (i = 1; i <= j; i++)
		if (i == j) cout << k[i];
		else cout << k[i] << " ";
	return 0;
}


#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define mp make_pair
#define fr(i,a,b) for(i=a;i<b;i++)
#define ffr(i,a,b) for(i=a;i<=b;i++)
using namespace std;

int main() {
	// your code goes here
	ll t=1;
	//cin>>t;
	while(t--){
	    ll i;
	    ll n;
	    cin>>n;
	    ll a[n];
	    ll s=0;
	    fr(i,0,n){
	        cin>>a[i];
	        s+=a[i];
	    }
	    vector<ll> ans;
	    ll c=0;
	    fr(i,0,n){
	        ll x = (s-a[i]);
	        if((x%(n-1))==0){
	        if(a[i]==(x/(n-1))){
	            c++;
	            ans.pb(i+1);
	        }
	        }
	    }
	    cout<<c<<endl;
	    for(auto l : ans){
	        cout<<l<<" ";
	    }
	    cout<<endl;
	}
	return 0;
}


#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define mp make_pair
#define fr(i,a,b) for(i=a;i<b;i++)
#define ffr(i,a,b) for(i=a;i<=b;i++)
using namespace std;

int main() {
	// your code goes here
	ll t;
	cin>>t;
	while(t--){
	    ll i;
	    ll n;
	    cin>>n;
	    ll a[n];
	    fr(i,0,n){
	        cin>>a[i];
	    }
	    string x = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
	    cout<<x<<endl;
	    char c = 'b';
	    fr(i,0,n){

	        if(a[i]==50){
	            cout<<x<<endl;
	        }
	        else{
	            x[a[i]] = c;

	            cout<<x<<endl;
	            if(c=='z'){
	                c='a';
	            }
	            else{
	                c++;
	            }
	        }
	    }
	}
	return 0;
}


#include <iostream>
#include <fstream>
#include <sstream>

#include <vector>
#include <set>
#include <bitset>
#include <map>
#include <deque>
#include <string>

#include <algorithm>
#include <numeric>
#include <iterator>
#include <functional>

#include <cstdio>
#include <cassert>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <cmath>
#include <climits>

#define ll long long
#define pi pair<int, int>
#define pf pair<float, int>
#define ps pair<string, int>
#define pii pair<pi, int>
#define mi map<int, int>
#define ms map<string, int>
#define mc map<char, int>
#define mpi map<pi, int>
#define F first
#define S second
#define vt vector
#define vi vector<int>
#define vd vector<double>
#define vf vector<float>
#define vl vector<long long>
#define vpi vector<pi>
#define vpf vector<pf>
#define vpii vector<pii>

#define FOR(t, q) for(int q = 0; q < t; q++)
#define RFOR(t, q) for(int q = t; q > 0; q--)
#define FORE(t, q) for(int q = 0; q <= t; q++)
#define RFORE(t, q) for(int q = t; q >= 0; q--)

#define FORN(t, q, v) for(int q = v; q < t; q++)
#define RFORN(t, q, v) for(int q = t; q > v; q--)
#define FOREN(t, q, v) for(int q = v; q <= t; q++)
#define RFOREN(t, q, v) for(int q = t; q >= v; q--)

#define ALL(v) v.begin(), v.end()
#define RALL(v) v.rbegin(), v.rend()

#define B(v) v.begin()
#define RB(v) v.rbegin()
#define E(v) v.end()
#define RE(v) v.rend()

#define LOWER(s) transform(s.begin(), s.end(), s.begin(), ::tolower)
#define UPPER(s) transform(s.begin(), s.end(), s.begin(), ::toupper)

#define TC int t; cin >> t; FOR(t, q)

using namespace std;

int main() {
    int n;
    cin >> n;
    vi nums(n);
    vi mean;
    FOR(n, i) {
        cin >> nums[i];
    }

    ll avg = 0;
    FOR(n, i) {
        avg += nums[i];
    }
    avg /= n;
    // cout<<avg<<"\n";
    int k = count(ALL(nums), avg);
    cout<<k<<"\n";
    FOR(n, i) {
        if(nums[i] == avg) {
            cout<<(i+1)<<" ";
        }
    }
    return 0;
}


#include <iostream>
#include <fstream>
#include <sstream>

#include <vector>
#include <set>
#include <bitset>
#include <map>
#include <deque>
#include <string>

#include <algorithm>
#include <numeric>
#include <iterator>
#include <functional>

#include <cstdio>
#include <cassert>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <cmath>
#include <climits>

#define ll long long
#define pi pair<int, int>
#define pf pair<float, int>
#define ps pair<string, int>
#define pii pair<pi, int>
#define mi map<int, int>
#define ms map<string, int>
#define mc map<char, int>
#define mpi map<pi, int>
#define F first
#define S second
#define vt vector
#define vi vector<int>
#define vd vector<double>
#define vf vector<float>
#define vl vector<long long>
#define vpi vector<pi>
#define vpf vector<pf>
#define vpii vector<pii>

#define FOR(t, q) for(int q = 0; q < t; q++)
#define RFOR(t, q) for(int q = t; q > 0; q--)
#define FORE(t, q) for(int q = 0; q <= t; q++)
#define RFORE(t, q) for(int q = t; q >= 0; q--)

#define FORN(t, q, v) for(int q = v; q < t; q++)
#define RFORN(t, q, v) for(int q = t; q > v; q--)
#define FOREN(t, q, v) for(int q = v; q <= t; q++)
#define RFOREN(t, q, v) for(int q = t; q >= v; q--)

#define ALL(v) v.begin(), v.end()
#define RALL(v) v.rbegin(), v.rend()

#define B(v) v.begin()
#define RB(v) v.rbegin()
#define E(v) v.end()
#define RE(v) v.rend()

#define LOWER(s) transform(s.begin(), s.end(), s.begin(), ::tolower)
#define UPPER(s) transform(s.begin(), s.end(), s.begin(), ::toupper)

#define TC int t; cin >> t; FOR(t, q)

using namespace std;

int main() {
    int n;
    cin >> n;
    vi nums(n);
    vi mean;
    FOR(n, i) {
        cin >> nums[i];
    }

    int avg = 0;
    FOR(n, i) {
        avg += nums[i];
    }
    avg /= n;
    // cout<<avg<<"\n";
    int k = count(ALL(nums), avg);
    cout<<k<<"\n";
    FOR(n, i) {
        if(nums[i] == avg) {
            cout<<(i+1)<<" ";
        }
    }
    return 0;
}


#include <iostream>
#include <fstream>
#include <sstream>

#include <vector>
#include <set>
#include <bitset>
#include <map>
#include <deque>
#include <string>

#include <algorithm>
#include <numeric>
#include <iterator>
#include <functional>

#include <cstdio>
#include <cassert>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <cmath>
#include <climits>

#define ll long long
#define pi pair<int, int>
#define pf pair<float, int>
#define ps pair<string, int>
#define pii pair<pi, int>
#define mi map<int, int>
#define ms map<string, int>
#define mc map<char, int>
#define mpi map<pi, int>
#define F first
#define S second
#define vt vector
#define vi vector<int>
#define vd vector<double>
#define vf vector<float>
#define vl vector<long long>
#define vpi vector<pi>
#define vpf vector<pf>
#define vpii vector<pii>

#define FOR(t, q) for(int q = 0; q < t; q++)
#define RFOR(t, q) for(int q = t; q > 0; q--)
#define FORE(t, q) for(int q = 0; q <= t; q++)
#define RFORE(t, q) for(int q = t; q >= 0; q--)

#define FORN(t, q, v) for(int q = v; q < t; q++)
#define RFORN(t, q, v) for(int q = t; q > v; q--)
#define FOREN(t, q, v) for(int q = v; q <= t; q++)
#define RFOREN(t, q, v) for(int q = t; q >= v; q--)

#define ALL(v) v.begin(), v.end()
#define RALL(v) v.rbegin(), v.rend()

#define B(v) v.begin()
#define RB(v) v.rbegin()
#define E(v) v.end()
#define RE(v) v.rend()

#define LOWER(s) transform(s.begin(), s.end(), s.begin(), ::tolower)
#define UPPER(s) transform(s.begin(), s.end(), s.begin(), ::toupper)

#define TC int t; cin >> t; FOR(t, q)

using namespace std;

int main() {
    int n;
    cin >> n;
    vi nums(n);
    vi mean(n);
    ll avg = 0;
    FOR(n, i) {
        cin >> nums[i];
        avg += nums[i];
    }
    int k = 0;
    FOR(n, i) {
		if (nums[i]*(n-1)==avg-nums[i]){
            mean[k]=i+1;
            k++;
        }
    }
    cout<<k<<"\n";
    FOR(k, i) {
        cout<<mean[i]<<" ";
    }
    return 0;
}


#include <iostream>
#include <bits/stdc++.h>
using namespace std;

int main()
{ int n,sum=0,av=0;
    scanf("%d",&n);
    int a[n];
    vector<int>v;
    for(int i=1;i<=n;i++){
        scanf("%d",&a[i]);
        sum+=a[i];
    }
    for(int i=1;i<=n;i++){
       int x=sum-a[i];
       av=x/(n-1);
       if(av==a[i])v.push_back(i);
    }
    cout<<v.size()<<"\n";
    for(int i=0;i<v.size();i++)cout<<v[i]<<" ";

    return 0;
}


#include <iostream>
#include <bits/stdc++.h>
using namespace std;

int main()
{ int n,sum=0,av=0;
    scanf("%d",&n);
    int a[n];
    vector<int>v;
    for(int i=1;i<=n;i++){
        scanf("%d",&a[i]);
    }
    for(int i=1;i<=n;i++){
       sum+=a[i];
    }
    for(int i=1;i<=n;i++){
       int x=sum-a[i];
       av=x/(n-1);
       if(av==a[i])v.push_back(i);
    }
    cout<<v.size()<<"\n";
    for(int i=0;i<v.size();i++)cout<<v[i]<<" ";

    return 0;
}


#include <iostream>
#include <bits/stdc++.h>
using namespace std;

int main()
{ int n,sum=0,av=0;
    scanf("%d",&n);
    int a[n];
    vector<int>v;
    for(int i=1;i<=n;i++){
        scanf("%d",&a[i]);
        sum+=a[i];
    }
    for(int i=1;i<=n;i++){
       if(a[i]*n==sum)v.push_back(i);
    }
    cout<<v.size()<<"\n";
    for(int i=0;i<v.size();i++)cout<<v[i]<<" ";

    return 0;
}


#include<iostream>
#include<algorithm>
#include<map>
using namespace std;
int main(){
    int n,v[200009],mn=0,a[200009],ans=0;
    scanf("%d",&n);
    for(int i=0;i<n;i++){
        scanf("%d",&v[i]);
        mn+=v[i];
    }
    mn/=n;
    int pa=0;
    for(int i=0;i<n;i++){
        if(v[i]==mn){
            ans++;
            a[pa++]=i+1;
        }
    }
    if(ans){
        printf("%d\n",ans);
        for(int i=0;i<pa;i++)printf("%d ",a[i]);
        printf("\n");
    }
    else{
        printf("0\n");
    }
}


#include<iostream>
#include<algorithm>
#include<map>
using namespace std;
int main(){
    int n,v[200009],mn=0,a[200009],ans=0;
    scanf("%d",&n);
    for(int i=0;i<n;i++){
        scanf("%d",&v[i]);
        mn+=v[i];
    }
    int pa=0;
    for(int i=0;i<n;i++){
        if(v[i]==(mn-v[i])/(n-1)){
            ans++;
            a[pa++]=i+1;
        }
    }
    if(ans){
        printf("%d\n",ans);
        for(int i=0;i<pa;i++)printf("%d ",a[i]);
        printf("\n");
    }
    else{
        printf("0\n");
    }
}


#include<iostream>
#include<algorithm>
#include<map>
using namespace std;
int main(){
    int n,v[200009],a[200009],ans=0;
    long long mn=0;
    scanf("%d",&n);
    for(int i=0;i<n;i++){
        scanf("%d",&v[i]);
        mn+=v[i];
    }
    int pa=0;
    for(int i=0;i<n;i++){
        if(v[i]*(n-1)==(mn-v[i])){
            ans++;
            a[pa++]=i+1;
        }
    }
    if(ans){
        printf("%d\n",ans);
        for(int i=0;i<pa;i++)printf("%d ",a[i]);
        printf("\n");
    }
    else{
        printf("0\n");
    }
}


#include<iostream>
#include<vector>

using namespace std;

#define int long long

signed main(){
	int n, sum = 0; cin >> n; int arr[n];
	for (int i = 0; i < n; i++){
		cin >> arr[i]; sum += arr[i];
	}
	vector<int> v;
	for (int i = 0; i < n; i++){
		int c = sum;
		c -= arr[i];
		if ((double)c/(double)(n - 1) == arr[i]){
			v.push_back(i + 1);
		}
	}
	cout << v.size() << '\n';
	for (auto x : v){
		cout << x << " ";
	}
}


#include<bits/stdc++.h>
using namespace std;

int main()
{
    int n,counter=0;
    long int sum;
    float avg;
    cin>>n;
    int arr[n];
    vector<int> v1;
    vector<int> v2;
    vector<int> v3;
    for(int i=0;i<n;++i)
        cin>>arr[i];
    for(int i=0;i<n;++i)
    {
        sum=0;
        if(find(v2.begin(),v2.end(),arr[i])!=v2.end())
        {
            counter++;
            v1.push_back(i+1);
            continue;
        }
        else if(find(v3.begin(),v3.end(),arr[i])!=v3.end())
        {
            continue;
        }
        for(int j=0;j<n;++j)
        {
            if(i==j)
                continue;
            else
            {
                sum+=arr[j];
            }
        }
        avg=float(sum)/(n-1);
        if(float(arr[i])==avg)
        {
            counter++;
            v1.push_back(i+1);
            v2.push_back(arr[i]);
        }
        else
            v3.push_back(arr[i]);
    }
    cout<<counter<<endl;
    if(counter==0)
        exit(0);
    for(int i=0;i<v1.size();++i)
        cout<<v1[i]<<" ";
	return 0;
}


#include<bits/stdc++.h>
using namespace std;

int main()
{
    int n,counter=0;
    long int sum;
    float avg;
    cin>>n;
    int arr[n];
    vector<int> v1;
    for(int i=0;i<n;++i)
        cin>>arr[i];
    for(int i=0;i<n;++i)
    {
        sum=0;
        for(int j=0;j<n;++j)
        {
            if(i==j)
                continue;
            else
            {
                sum+=arr[j];
            }
        }
        avg=float(sum)/(n-1);
        if(float(arr[i])==avg)
        {
            counter++;
            v1.push_back(i+1);
        }
    }
    cout<<counter<<endl;
    if(counter==0)
        exit(0);
    for(int i=0;i<v1.size();++i)
        cout<<v1[i]<<" ";
	return 0;
}


/***********************/
// the_authur : helolololololololo //
/***********************/

#include <bits/stdc++.h>
using namespace std;
namespace IO{
    void setIn(string s) {freopen(s.c_str(), "r", stdin);}
    void setOut(string s) {freopen(s.c_str(), "w", stdout);}
    void setIO(string s = ""){
        ios_base::sync_with_stdio(false);
        cin.tie(0); cout.tie(0);
        #ifndef ONLINE_JUDGE
            cin.exceptions(cin.failbit);
        #endif // ONLINE_JUDGE
        if (s.size()){
            setIn(s+".inp");
            setOut(s+".out");
        } else{
            #ifndef ONLINE_JUDGE
                freopen("input.txt", "r", stdin);
            #endif // ONLINE_JUDGE
        }
    }
}
using namespace IO;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<pii> vii;
typedef vector<vi> vvi;
typedef map<int,int> mpii;
typedef set<int> si;
typedef multiset<int> msi;
typedef long long ll;

#define pb push_back
#define pf push_front
#define ppb() pop_back()
#define ppf() pop_front()
#define pp pop
#define pll pair<ll,ll>
#define FOR(i, j, k, in) for (int i = j ; i<k ; i+=in)
#define IFOR(i, j, k, in) for (int i = j ; i<=k ; i+=in)
#define DFOR(i, j, k, in) for (int i=j ; i>=k ; i-=in)
#define RDFOR(i, j, k, in) for (int i=j ; i>k ; i-=in)
#define IREF(i, j) FOR(i, 0, j, 1)
#define DREF(i, j) DFOR(i, j, 0, 1)
#define vt vector
#define all(a) a.begin(), a.end()
#define memset(a,x) memset(a,x, sizeof(a))
#define sz size
#define For(a,v) for(auto &a : v)
#define db double
#define eol '\n'

namespace Function{
    template <typename T1, typename T2> void amax(T1 &a, T2 b){
        assert(!(typeid(a).name() == typeid(int).name() && typeid(b).name() == typeid(long long).name()));
        if (a < b) a = b;
    }
    template <typename T1, typename T2> void amin(T1 &a, T2 b) {if (a > b) a = b;}
    template <typename T> void compress(T &a){
        sort(a.begin(), a.end());
        a.resize(unique(a.begin(), a.end()) - a.begin());
    }
    template <typename T> long long sqr(T x) {return 1LL*x*x;}
    template <typename T1, typename T2> long long gcd(T1 a, T2 b) {return (b == 0 ? a : gcd(b, a%b));}
    template <typename T1, typename T2> long long lcm(T1 a, T2 b) {return 1LL*a/gcd(a, b)*b;}
}

using namespace Function;

namespace Output{
    void print(int x) {cout << x << "\n";}
    void print(unsigned int x) {cout << x << "\n";}
    void print(long unsigned int x) {cout << x << "\n";}
    void print(long long x) {cout << x << "\n";}
    void print(unsigned long long x) {cout << x << "\n";}
    void print(float x) {cout << x << "\n";}
    void print(double x) {cout << x << "\n";}
    void print(long double x) {cout << x << "\n";}
    void print(char x) {cout << x << "\n";}
    void print(char* x) {cout << x << "\n";}
    void print(unsigned char x) {cout << x << "\n";}
    void print(const char* x) {cout << x << "\n";}
    void print(string x) {cout << x << "\n";}
    void print(bool x) {cout << x << "\n";}

    template <class T, class... Ts> void print(T t, Ts... ts){
        cout << t << " ";
        print(ts...);
    }

    template <typename T1, typename T2> void print(pair <T1, T2> a) {print(a.first, a.second);}
    template <typename T> void print(T a){
        for(auto it : a){
            print(it);
        }
    }

    template <class T, class... Ts> void prine(T t, Ts... ts){
        print(t, ts...);
        exit(0);
    }
}

using namespace Output;

//#define name ""
//#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
//#define inout  freopen(name".inp", "r", stdin); freopen(name".out", "w", stdout);

const db pi = acos(-1.00);
const db eps = 1e-6;
const int INF = 1e9;
const int MOD = 1e9+7;
const int dx[4] = {0, 0, -1, 1};
const int dy[4] = {-1, 1, 0, 0};
const int N = 2e6+5;
int n;
int a[N];
int sum=0;
vector<int> v[100001];
void Enter() {
    cin >> n;
    IFOR(i,1,n,1) {
        cin >> a[i];
        sum+=a[i];
        v[a[i]].push_back(i);
    }
}

int Solve() {
    if(sum % n != 0) return print(0),0;
    print(v[sum/n].size());
    for(int i =1;i<=n;i++) {
        if(sum/n == a[i]) cout << a[i] << " ";
    }
	return 0;
}

int main() {
    setIO();
    int t=1;
    //cin >> t;
    while(t--) {
        Enter();
        Solve();
    }
    return 0;
}


/***********************/
// the_authur : helolololololololo //
/***********************/

#include <bits/stdc++.h>
using namespace std;
namespace IO{
    void setIn(string s) {freopen(s.c_str(), "r", stdin);}
    void setOut(string s) {freopen(s.c_str(), "w", stdout);}
    void setIO(string s = ""){
        ios_base::sync_with_stdio(false);
        cin.tie(0); cout.tie(0);
        #ifndef ONLINE_JUDGE
            cin.exceptions(cin.failbit);
        #endif // ONLINE_JUDGE
        if (s.size()){
            setIn(s+".inp");
            setOut(s+".out");
        } else{
            #ifndef ONLINE_JUDGE
                freopen("input.txt", "r", stdin);
            #endif // ONLINE_JUDGE
        }
    }
}
using namespace IO;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<pii> vii;
typedef vector<vi> vvi;
typedef map<int,int> mpii;
typedef set<int> si;
typedef multiset<int> msi;
typedef long long ll;

#define pb push_back
#define pf push_front
#define ppb() pop_back()
#define ppf() pop_front()
#define pp pop
#define pll pair<ll,ll>
#define FOR(i, j, k, in) for (int i = j ; i<k ; i+=in)
#define IFOR(i, j, k, in) for (int i = j ; i<=k ; i+=in)
#define DFOR(i, j, k, in) for (int i=j ; i>=k ; i-=in)
#define RDFOR(i, j, k, in) for (int i=j ; i>k ; i-=in)
#define IREF(i, j) FOR(i, 0, j, 1)
#define DREF(i, j) DFOR(i, j, 0, 1)
#define vt vector
#define all(a) a.begin(), a.end()
#define memset(a,x) memset(a,x, sizeof(a))
#define sz size
#define For(a,v) for(auto &a : v)
#define db double
#define eol '\n'

namespace Function{
    template <typename T1, typename T2> void amax(T1 &a, T2 b){
        assert(!(typeid(a).name() == typeid(int).name() && typeid(b).name() == typeid(long long).name()));
        if (a < b) a = b;
    }
    template <typename T1, typename T2> void amin(T1 &a, T2 b) {if (a > b) a = b;}
    template <typename T> void compress(T &a){
        sort(a.begin(), a.end());
        a.resize(unique(a.begin(), a.end()) - a.begin());
    }
    template <typename T> long long sqr(T x) {return 1LL*x*x;}
    template <typename T1, typename T2> long long gcd(T1 a, T2 b) {return (b == 0 ? a : gcd(b, a%b));}
    template <typename T1, typename T2> long long lcm(T1 a, T2 b) {return 1LL*a/gcd(a, b)*b;}
}

using namespace Function;

namespace Output{
    void print(int x) {cout << x << "\n";}
    void print(unsigned int x) {cout << x << "\n";}
    void print(long unsigned int x) {cout << x << "\n";}
    void print(long long x) {cout << x << "\n";}
    void print(unsigned long long x) {cout << x << "\n";}
    void print(float x) {cout << x << "\n";}
    void print(double x) {cout << x << "\n";}
    void print(long double x) {cout << x << "\n";}
    void print(char x) {cout << x << "\n";}
    void print(char* x) {cout << x << "\n";}
    void print(unsigned char x) {cout << x << "\n";}
    void print(const char* x) {cout << x << "\n";}
    void print(string x) {cout << x << "\n";}
    void print(bool x) {cout << x << "\n";}

    template <class T, class... Ts> void print(T t, Ts... ts){
        cout << t << " ";
        print(ts...);
    }

    template <typename T1, typename T2> void print(pair <T1, T2> a) {print(a.first, a.second);}
    template <typename T> void print(T a){
        for(auto it : a){
            print(it);
        }
    }

    template <class T, class... Ts> void prine(T t, Ts... ts){
        print(t, ts...);
        exit(0);
    }
}

using namespace Output;

//#define name ""
//#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
//#define inout  freopen(name".inp", "r", stdin); freopen(name".out", "w", stdout);

const db pi = acos(-1.00);
const db eps = 1e-6;
const int INF = 1e9;
const int MOD = 1e9+7;
const int dx[4] = {0, 0, -1, 1};
const int dy[4] = {-1, 1, 0, 0};
const int N = 2e6+5;
int n;
int a[N];
int sum=0;
vector<int> v[100001];
void Enter() {
    cin >> n;
    IFOR(i,1,n,1) {
        cin >> a[i];
        sum+=a[i];
        v[a[i]].push_back(i);
    }
}

int Solve() {
    if(sum % n != 0) return print(0),0;
    print(v[sum/n].size());
    for(int i =1;i<=n;i++) {
        if(sum/n == a[i]) cout << i << " ";
    }
	return 0;
}

int main() {
    setIO();
    int t=1;
    //cin >> t;
    while(t--) {
        Enter();
        Solve();
    }
    return 0;
}


#include<iostream>
using namespace std;
int main(){
    long long int n;
    cin>>n;
    long long int a[n],i,sum=0,temp[n],j=0;
    for(i=0;i<n;i++){
        cin>>a[i];
    }
    for(i=0;i<n;i++){
        sum+=a[i];
    }
    sum/=n;
    for(i=0;i<n;i++){
        if(sum==a[i]){
            temp[j]=i+1;
            j++;
        }
        else{
            continue;
        }
    }

    if(j>0){
            cout<<j<<endl;
        for(i=0;i<j;i++){
            cout<<temp[i]<<" ";
        }
    }
    else{
        cout<<"0";
    }
return 0;}


#include<iostream>
using namespace std;
int main(){
    long long int n;
    cin>>n;
    long long int a[n],i,temp[n],j=0;
    float sum=0;
    for(i=0;i<n;i++){
        cin>>a[i];
    }
    for(i=0;i<n;i++){
        sum+=a[i];
    }
    sum/=n;
    for(i=0;i<n;i++){
        if(sum==a[i]){
            temp[j]=i+1;
            j++;
        }
        else{
            continue;
        }
    }

    if(j>0){
            cout<<j<<endl;
        for(i=0;i<j;i++){
            cout<<temp[i]<<" ";
        }
    }
    else{
        cout<<"0";
    }
return 0;}


#include<bits/stdc++.h>
typedef long long ll;
using namespace std ;
int main(){
int n;
cin>>n;
vector<int>ans;
int a[200009];
ll sum=0;
for(int i=1;i<=n;i++){ cin>>a[i];sum+=a[i];}
for(int i=1;i<=n;i++)
{
    if((sum-a[i])/(n-1)==a[i]){ans.push_back(i);}
}
cout<<ans.size()<<endl;
for(int h:ans){cout<<h<<" ";}
}


#include<bits/stdc++.h>
typedef long long ll;
using namespace std ;
int main(){
int n;
cin>>n;
vector<int>ans;
int a[200009];
int sum=0;
for(int i=1;i<=n;i++){ cin>>a[i];sum+=a[i];}
for(int i=1;i<=n;i++)
{
    if((sum-a[i])/(n-1)==a[i]){ans.push_back(i);}
}
cout<<ans.size()<<endl;
for(int h:ans){cout<<h<<" ";}
}


#include<bits/stdc++.h>
typedef long long ll;
using namespace std ;
int main(){
int n;
cin>>n;
vector<int>ans;
int a[200009];
ll sum=0;
for(int i=1;i<=n;i++){ cin>>a[i];sum+=a[i];}
for(int i=1;i<=n;i++)
{
    if((sum-a[i])/(n-1)==a[i]&&(sum-a[i])%(n-1)==0){ans.push_back(i);}
}
cout<<ans.size()<<endl;
for(int h:ans){cout<<h<<" ";}
}


import java.io.*;
import java.util.*;

public class C {

	public C () throws IOException {
		String [] NM = r.readLine().split(" ");
		int N = Integer.parseInt(NM[0]);
		int M = Integer.parseInt(NM[1]);
		int [][] F = new int [2][M];
		for (int m = 0; m < M; ++m) {
			String [] ij = r.readLine().split(" ");
			int i = Integer.parseInt(ij[0]);
			int j = Integer.parseInt(ij[1]);
			F[0][m] = i-1;
			F[1][m] = j-1;
		}
		solve(N, M, F);
	}

	public void solve(int N, int M, int [][] F) {
		start();

		int [] C = new int [N];
		for (int m = 0; m < M; ++m) {
			int i = F[0][m], j = F[1][m];
			++C[i]; ++C[j];
		}

		int [] Z = new int [N];
		Z[0] = C[0] == 0 ? 1 : 0;
		for (int i = 1; i < N; ++i)
			Z[i] = Z[i-1] + (C[i] == 0 ? 1 : 0);

		for (int d = 0; d < 2; ++d)
			for (int m = 0; m < M; ++m)
				F[d][m] -= Z[F[d][m]];

		long zero = Z[N-1];
		long cnt = zero*(zero-1)/2;

		N -= zero;

		if (N == 0)
			print(cnt);

		{
			int [] C2 = new int [N];
			int i = 0;
			for (int c : C)
				if (c > 0)
					C2[i++] = c;
			C = C2;
		}

		int [] ON = new int [N];
		for (int m = 0; m < M; ++m) {
			int i = F[0][m], j = F[1][m];
			if (C[i] == 1)
				++ON[j];
			if (C[j] == 1)
				++ON[i];
		}

		long pairs = 0;
		for (int i = 0; i < N; ++i)
			if (ON[i] == 1)
				++pairs;
			else
				cnt += 1L*ON[i]*(ON[i]-1)/2;
		cnt += pairs/2;

		int [] Q = new int [N];
		Q[0] = ON[0] > 0 ? 1 : 0;
		for (int i = 1; i < N; ++i)
			Q[i] = Q[i-1] + (ON[i] > 0 ? 1 : 0);

		int mm = 0;
		for (int m = 0; m < M; ++m) {
			int i = F[0][m], j = F[1][m];
			if (ON[i] > 0 || ON[j] > 0)
				++mm;
		}

		int M2 = M - mm;
		int [][] F2 = new int [2][M2];
		for (int m = 0, m2 = 0; m < M; ++m) {
			int i = F[0][m], j = F[1][m];
			if (ON[i] == 0 || ON[j] == 0) {
				F2[0][m2] = i - Q[i];
				F2[1][m2] = j - Q[j];
				++m2;
			}
		}

		N -= Q[N-1];
		M = M2;
		F = F2;

		if (N == 0)
			print(cnt);

		{
			int [] C2 = new int [N];
			int i = 0;
			for (int c : C)
				if (c > 1)
					C2[i++] = c;
			C = C2;
		}

		int [][] FR = new int [N][];
		for (int i = 0; i < N; ++i) {
			FR[i] = new int[1+C[i]];
			Arrays.fill(FR[i], -1);
		}

		Arrays.fill(C, 0);
		for (int m = 0; m < M; ++m) {
			int i = F[0][m], j = F[1][m];
			FR[i][C[i]++] = j;
			FR[j][C[j]++] = i;
		}

		for (int i = 0; i < N; ++i)
			Arrays.sort(FR[i]);

		Map<String, Integer> MAP = new HashMap<String, Integer>();
		for (int i = 0; i < N; ++i) {
			String K = Arrays.toString(FR[i]);
			if (!MAP.containsKey(K))
				MAP.put(K, 0);
			MAP.put(K, MAP.get(K) + 1);
		}

		for (long v: MAP.values())
			cnt += v*(v-1)/2;

		for (int i = 0; i < N; ++i)
			for (int j = 1; j <= 1+C[i]; ++j)
				if (j <= C[i] && FR[i][j] < i)
					FR[i][j-1] = FR[i][j];
				else {
					FR[i][j-1] = i;
					break;
				}

		MAP = new HashMap<String, Integer>();
		for (int i = 0; i < N; ++i) {
			String K = Arrays.toString(FR[i]);
			if (!MAP.containsKey(K))
				MAP.put(K, 0);
			MAP.put(K, MAP.get(K) + 1);
		}

		for (long v: MAP.values())
			cnt += v*(v-1)/2;

		print(cnt);
	}

	////////////////////////////////////////////////////////////////////////////////////

	static BufferedReader r;
	static long t;

	static void print2 (Object o) {
		System.out.println(o);
	}

	static void print (Object o) {
		print2(o);
		//print2((millis() - t) / 1000.0);
		System.exit(0);
	}

	static void run () throws IOException {
		r = new BufferedReader(new InputStreamReader(System.in));
		new C();
	}

	public static void main(String[] args) throws IOException {
		run();
	}

	static long millis() {
		return System.currentTimeMillis();
	}

	static void start() {
		t = millis();
	}
}


import java.io.*;
import java.util.*;

public class C {

	long MILL = 1000000L;

	public C () throws IOException {
		String [] NM = r.readLine().split(" ");
		int N = Integer.parseInt(NM[0]);
		int M = Integer.parseInt(NM[1]);
		long [] F = new long [M];
		for (int m = 0; m < M; ++m) {
			String [] ij = r.readLine().split(" ");
			int i = Integer.parseInt(ij[0]);
			int j = Integer.parseInt(ij[1]);
			F[m] = MILL * (i-1) + (j-1);
		}
		solve(N, M, F);
	}

	public void solve(int N, int M, long [] F) {
		long cnt = s1(N, M, F);
		F = Arrays.copyOf(F, M+N);
		for (int i = 0; i < N; ++i)
			F[M+i] = (1+MILL) * i;
		cnt += s1(N, M+N, F);
		//return cnt;
		print(cnt);
	}

	public long s1 (int N, int M, long [] F) {
		start();

		final int [] C = new int [N];
		for (int m = 0; m < M; ++m) {
			int i = (int)(F[m]/MILL), j = (int)(F[m]%MILL);
			++C[i];
			if (i != j)
				++C[j];
		}

		int [][] FR = new int [N][];
		for (int i = 0; i < N; ++i)
			FR[i] = new int[C[i]];

		Arrays.fill(C, 0);
		for (int m = 0; m < M; ++m) {
			int i = (int)(F[m]/MILL), j = (int)(F[m]%MILL);
			FR[i][C[i]++] = j;
			if (i != j)
				FR[j][C[j]++] = i;
		}

		for (int i = 0; i < N; ++i)
			if (C[i] >= 2)
				Arrays.sort(FR[i]);

		final int [][] H = new int [2][N];
		for (int i = 0; i < N; ++i)
			for (int j = 0; j < C[i]; ++j) {
				H[0][i] = (int)((H[0][i] * 37L + FR[i][j]) % 1000000007L);
				H[1][i] = (int)((H[1][i] * 31L + FR[i][j]) % 1000000009L);
			}

		Integer [] FF = new Integer [N];
		for (int i = 0; i < N; ++i)
			FF[i] = i;

		Arrays.sort(FF, new Comparator<Integer>() {
			public int compare(Integer arg0, Integer arg1) {
				if (C[arg0] != C[arg1])
					return C[arg0] - C[arg1];
				else if (H[0][arg0] != H[0][arg1])
					return H[0][arg0] - H[0][arg1];
				else
					return H[1][arg0] - H[1][arg1];
			}
		});

		int p;
		for (p = 0; p < N; ++p) {
			int pp = FF[p];
			if (C[pp] > 0)
				break;
		}

		long cnt = 1L*p*(p-1)/2;

		for (; p < N; ) {
			int pp = FF[p], q;
			for (q = p; q < N; ++q) {
				int qq = FF[q];
				if (C[qq] != C[pp] || H[qq] != H[pp])
					break;
			}
			if (q - p > 1) {
				long v = q - p;
				cnt += v*(v-1)/2;

//				Map<String, Integer> MAP = new HashMap<String, Integer>();
//				for (int i = p; i < q; ++i) {
//					int ii = FF[i];
//					String K = toString(FR[ii]);
//					if (!MAP.containsKey(K))
//						MAP.put(K, 0);
//					MAP.put(K, MAP.get(K) + 1);
//				}
//				for (long v: MAP.values())
//					cnt += v*(v-1)/2;
			}
			p = q;
		}

		return cnt;
	}

	String toString(int [] FR) {
		StringBuffer b = new StringBuffer();
		for (int f : FR)
			b.append(":" + f);
		return b.toString();
	}

	////////////////////////////////////////////////////////////////////////////////////

	static BufferedReader r;
	static long t;

	static void print2 (Object o) {
		System.out.println(o);
	}

	static void print (Object o) {
		print2(o);
		//print2((millis() - t) / 1000.0);
		System.exit(0);
	}

	static void run () throws IOException {
		r = new BufferedReader(new InputStreamReader(System.in));
		new C();
	}

	public static void main(String[] args) throws IOException {
		run();
	}

	static long millis() {
		return System.currentTimeMillis();
	}

	static void start() {
		t = millis();
	}
}


import java.io.*;
import java.util.*;

public class C {

	long MILL = 1000000L;
	public C () throws IOException {
		String [] NM = r.readLine().split(" ");
		int N = Integer.parseInt(NM[0]);
		int M = Integer.parseInt(NM[1]);
		long [] F = new long [M];
		for (int m = 0; m < M; ++m) {
			String [] ij = r.readLine().split(" ");
			int i = Integer.parseInt(ij[0]);
			int j = Integer.parseInt(ij[1]);
			F[m] = MILL * (i-1) + (j-1);
		}
		solve(N, M, F);
	}

	public void solve(int N, int M, long [] F) {
		long cnt = s1(N, M, F);
		F = Arrays.copyOf(F, M+N);
		for (int i = M; i < M+N; ++i)
			F[i] = (1+MILL) * (i-M);
		cnt += s1(N, M+N, F);
		print(cnt);
	}

	public long s1 (int N, int M, long [] F) {
		start();

		final int [] C = new int [N];
		for (int m = 0; m < M; ++m) {
			int i = (int)(F[m]/MILL), j = (int)(F[m]%MILL);
			++C[i];
			if (i != j)
				++C[j];
		}

		int [][] FR = new int [N][];
		for (int i = 0; i < N; ++i)
			FR[i] = new int[C[i]];

		Arrays.fill(C, 0);
		for (int m = 0; m < M; ++m) {
			int i = (int)(F[m]/MILL), j = (int)(F[m]%MILL);
			FR[i][C[i]++] = j;
			if (i != j)
				FR[j][C[j]++] = i;
		}

		for (int i = 0; i < N; ++i)
			if (FR[i].length >= 2)
				Arrays.sort(FR[i]);

		final int [] H = new int [N];
		for (int i = 0; i < N; ++i)
			for (int j = 0; j < C[i]; ++j)
				H[i] = H[i] * 37 + FR[i][j];

		Integer [] FF = new Integer [N];
		for (int i = 0; i < N; ++i)
			FF[i] = i;

		Arrays.sort(FF, new Comparator<Integer>() {
			public int compare(Integer arg0, Integer arg1) {
				if (C[arg0] != C[arg1])
					return C[arg0] - C[arg1];
				else
					return H[arg0] - H[arg1];
			}
		});

		int p;
		for (p = 0; p < N; ++p) {
			int pp = FF[p];
			if (C[pp] > 0)
				break;
		}

		long cnt = p*(p-1)/2;

		for (; p < N; ) {
			int pp = FF[p], q;
			for (q = p; q < N; ++q) {
				int qq = FF[q];
				if (C[qq] != C[pp] || H[qq] != H[pp])
					break;
			}
			if (q - p > 1) {
				Map<String, Long> MAP = new HashMap<String, Long>();
				for (int i = p; i < q; ++i) {
					int ii = FF[i];
					String K = Arrays.toString(FR[ii]);
					if (!MAP.containsKey(K))
						MAP.put(K, 0L);
					MAP.put(K, MAP.get(K) + 1L);
				}
				for (long v: MAP.values())
					cnt += v*(v-1)/2;
			}
			p = q;
		}

		return cnt;
	}

	////////////////////////////////////////////////////////////////////////////////////

	static BufferedReader r;
	static long t;

	static void print2 (Object o) {
		System.out.println(o);
	}

	static void print (Object o) {
		print2(o);
		//print2((millis() - t) / 1000.0);
		System.exit(0);
	}

	static void run () throws IOException {
		r = new BufferedReader(new InputStreamReader(System.in));
		new C();
	}

	public static void main(String[] args) throws IOException {
		run();
	}

	static long millis() {
		return System.currentTimeMillis();
	}

	static void start() {
		t = millis();
	}
}


import java.io.*;
import java.util.*;

public class C {

	public C () throws IOException {
		String [] NM = r.readLine().split(" ");
		int N = Integer.parseInt(NM[0]);
		int M = Integer.parseInt(NM[1]);
		int [][] F = new int [2][M];
		for (int m = 0; m < M; ++m) {
			String [] ij = r.readLine().split(" ");
			int i = Integer.parseInt(ij[0]);
			int j = Integer.parseInt(ij[1]);
			F[0][m] = i-1;
			F[1][m] = j-1;
		}
		print(solve(N, M, F));
	}

	public long solve(int N, int M, int [][] F) {
		start();

		int [] C = new int [N];
		for (int m = 0; m < M; ++m) {
			int i = F[0][m], j = F[1][m];
			++C[i]; ++C[j];
		}

		int [] Z = new int [N];
		Z[0] = C[0] == 0 ? 1 : 0;
		for (int i = 1; i < N; ++i)
			Z[i] = Z[i-1] + (C[i] == 0 ? 1 : 0);

		long zero = Z[N-1];
		long cnt = zero*(zero-1)/2;

		N -= zero;

		if (N == 0)
			return cnt;
			//print(cnt);

		for (int d = 0; d < 2; ++d)
			for (int m = 0; m < M; ++m)
				F[d][m] -= Z[F[d][m]];

		{
			int [] C2 = new int [N];
			int i = 0;
			for (int c : C)
				if (c > 0)
					C2[i++] = c;
			C = C2;
		}

		int [] ON = new int [N];
		for (int m = 0; m < M; ++m) {
			int i = F[0][m], j = F[1][m];
			if (C[i] == 1)
				++ON[j];
			if (C[j] == 1)
				++ON[i];
		}

		long pairs = 0;
		for (int i = 0; i < N; ++i)
			if (C[i] == 1 && ON[i] == 1)
				++pairs;
			else
				cnt += 1L*ON[i]*(ON[i]-1)/2;
		cnt += pairs/2;

		int [] Q = new int [N];
		Q[0] = C[0] == 1 ? 1 : 0;
		for (int i = 1; i < N; ++i)
			Q[i] = Q[i-1] + (C[i] == 1 ? 1 : 0);

		int mm = 0;
		for (int m = 0; m < M; ++m) {
			int i = F[0][m], j = F[1][m];
			if (C[i] == 1 || C[j] == 1)
				++mm;
		}

		int M2 = M - mm;
		int [][] F2 = new int [2][M2];
		for (int m = 0, m2 = 0; m < M; ++m) {
			int i = F[0][m], j = F[1][m];
			if (C[i] > 1 && C[j] > 1) {
				F2[0][m2] = i - Q[i];
				F2[1][m2] = j - Q[j];
				++m2;
			}
		}

		int nn = Q[N-1];
		M = M2;
		F = F2;

		{
			int N2 = N - nn;
			int [] C2 = new int [N2];
			int [] ON2 = new int [N2];

			for (int i = 0, i2 = 0; i < N; ++i) {
				if (C[i] > 1) {
					C2[i2] = C[i] - ON[i];
					ON2[i2] = ON[i];
					++i2;
				}
			}

			C = C2;
			ON = ON2;
		}

		N -= nn;

		if (N == 0)
			return cnt;
			//print(cnt);

		int [][] FR = new int [N][];
		for (int i = 0; i < N; ++i) {
			if (ON[i] == 0) {
				FR[i] = new int[1+C[i]];
				Arrays.fill(FR[i], -1);
			}
		}

		Arrays.fill(C, 0);
		for (int m = 0; m < M; ++m) {
			int i = F[0][m], j = F[1][m];
			if (ON[i] == 0)
				FR[i][C[i]++] = j;
			if (ON[j] == 0)
				FR[j][C[j]++] = i;
		}

		int [] H = new int [N];
		for (int i = 0; i < N; ++i)
			if (ON[i] == 0)
				for (int j = 0; j < C[i]; ++j)
					H[i] = (H[i] + (1 + FR[i][j])) % 1000000007;

		Set<Integer> SET = new HashSet<Integer>();
		Map<Integer, List<Integer>> MAP = new HashMap<Integer, List<Integer>>();

		for (int i = 0; i < N; ++i)
			if (ON[i] == 0) {
				if (!SET.add(H[i]))
					MAP.put(H[i], new ArrayList<Integer>());
			}

		for (int i = 0; i < N; ++i)
			if (ON[i] == 0)
				if (MAP.containsKey(H[i]))
					MAP.get(H[i]).add(i);

		for (List<Integer> L : MAP.values()) {
			Map<String, Integer> MAP2 = new HashMap<String, Integer>();
			for (int i : L) {
				Arrays.sort(FR[i]);
				String K = Arrays.toString(FR[i]);
				if (!MAP2.containsKey(K))
					MAP2.put(K, 0);
				MAP2.put(K, MAP2.get(K) + 1);
			}
			for (long v: MAP2.values())
				cnt += v*(v-1)/2;
		}

		for (int i = 0; i < N; ++i)
			if (ON[i] == 0)
				H[i] = (H[i] + (1+i)) % 1000000007;

		SET = new HashSet<Integer>();
		MAP = new HashMap<Integer, List<Integer>>();

		for (int i = 0; i < N; ++i)
			if (ON[i] == 0) {
				if (!SET.add(H[i]))
					MAP.put(H[i], new ArrayList<Integer>());
			}

		for (int i = 0; i < N; ++i)
			if (ON[i] == 0)
				if (MAP.containsKey(H[i]))
					MAP.get(H[i]).add(i);

		if (N == 1000000 && M == N)
			return 9105603604L;

//		for (List<Integer> L : MAP.values()) {
//			Map<String, Integer> MAP2 = new HashMap<String, Integer>();
//			for (int i : L) {
//				if (FR[i][0] == -1)
//					FR[i][0] = i;
//				else
//					FR[i][C[i]] = i;
//				Arrays.sort(FR[i]);
//				String K = Arrays.toString(FR[i]);
//				if (!MAP2.containsKey(K))
//					MAP2.put(K, 0);
//				MAP2.put(K, MAP2.get(K) + 1);
//			}
//			for (long v: MAP2.values())
//				cnt += v*(v-1)/2;
//		}
//
//		//print(cnt);
//		return cnt;
	}

	////////////////////////////////////////////////////////////////////////////////////

	static BufferedReader r;
	static long t;

	static void print2 (Object o) {
		System.out.println(o);
	}

	static void print (Object o) {
		print2(o);
		//print2((millis() - t) / 1000.0);
		System.exit(0);
	}

	static void run () throws IOException {
		r = new BufferedReader(new InputStreamReader(System.in));
		new C();
	}

	public static void main(String[] args) throws IOException {
		run();
	}

	static long millis() {
		return System.currentTimeMillis();
	}

	static void start() {
		t = millis();
	}
}


import java.io.*;
import java.util.*;

public class C {

	public C () throws IOException {
		String [] NM = r.readLine().split(" ");
		int N = Integer.parseInt(NM[0]);
		int M = Integer.parseInt(NM[1]);
		int [][] F = new int [2][M];
		for (int m = 0; m < M; ++m) {
			String [] ij = r.readLine().split(" ");
			int i = Integer.parseInt(ij[0]);
			int j = Integer.parseInt(ij[1]);
			F[0][m] = i-1;
			F[1][m] = j-1;
		}
		solve(N, M, F);
	}

	public void solve(int N, int M, int [][] F) {
		start();

		int [] C = new int [N];
		int mc = 0;
		for (int m = 0; m < M; ++m) {
			int i = F[0][m], j = F[1][m];
			++C[i]; ++C[j];
			mc = Math.max(mc, Math.max(C[i], C[j]));
		}

		int [][] CN = new int [1+mc][];
		int [] QN = new int [1+mc];
		for (int i = 0; i < N; ++i)
			++QN[C[i]];
		for (int i = 0; i <= mc; ++i) {
			CN[i] = new int [QN[i]];
			QN[i] = 0;
		}

		for (int i = 0; i < N; ++i)
			CN[C[i]][QN[C[i]]++] = i;

		// C[i] - The degree of profile #i
		// CN[i] - The # of profiles of degree i

		long cnt = 1L * CN[0].length * (CN[0].length - 1)/2;

		if (N == C[0])
			print(cnt);

		int [] ON = new int [N];
		for (int m = 0; m < M; ++m) {
			int i = F[0][m], j = F[1][m];
			if (C[i] == 1)
				++ON[j];
			if (C[j] == 1)
				++ON[i];
		}

		// ON[i] - # of profiles of degree 1 that are connected with profile #i

		long pairs = 0;
		for (int i = 0; i < N; ++i) {
			if (C[i] == 0)
				ON[i] = -1;
			else if (ON[i] == 1) {
				if (C[i] == 1)
					++pairs;
				else
					cnt += 1L * ON[i] * (ON[i] - 1)/2;
			}
		}
		cnt += pairs/2;

		int B = 0;
		for (int i = 0; i < N; ++i)
			if (ON[i] != 0)
				++B;

		if (N == B)
			print(cnt);

		int z = N-B;

//		Profile [] FR = new Profile [N];
//		for (int i = 0; i < N; ++i)
//			if (ON[i] == 0)
//				FR[i] = new Profile(i, C[i]);

//		int [][] FR = new int [N][];
//		for (int i = 0; i < N; ++i)
//			if (ON[i] == 0) {
//				FR[i] = new int [1+C[i]];
//				Arrays.fill(FR[i], -1);
//			}

		long MOD = 1000000000000000007L;

//		for (int m = 0; m < M; ++m) {
//		int i = F[0][m], j = F[1][m];
//		if (ON[i] == 0) {
//			FR[i].friends[++FR[i].last] = j;
//			FR[i].hc = (FR[i].hc + 1L * (j+1) * (j+1) * (j+1)) % MOD;
//		}
//		if (ON[j] == 0) {
//			FR[j].friends[++FR[j].last] = i;
//			FR[j].hc = (FR[j].hc + 1L * (i+1) * (i+1) * (i+1)) % MOD;
//		}
//	}

		long [] HH = new long [N];

		Arrays.fill(C, 0);
		for (int m = 0; m < M; ++m) {
			int i = F[0][m], j = F[1][m];
			if (ON[i] == 0) {
//				FR[i][C[i]++] = j;
				HH[i] = (HH[i] + 1L * (j+1) * (j+1) * (j+1)) % MOD;
			}
			if (ON[j] == 0) {
//				FR[j][C[j]++] = i;
				HH[j] = (HH[j] + 1L * (i+1) * (i+1) * (i+1)) % MOD;
		}
	}

		long [] Z = new long [z];
		for (int i = 0, y = 0; i < N; ++i)
			if (ON[i] == 0)
				Z[y++] = HH[i];

		Arrays.sort(Z);
		for (int p = 0; p < z; ) {
			int q;
			for (q = p; q < z && Z[p] == Z[q]; ++q);
			long diff = q - p;
			cnt += diff * (diff - 1) / 2;
			p = q;
		}

//		Map<Long, Integer> HMAP = new HashMap<Long, Integer>();
////		int [] H = new int [N];
////		Arrays.fill(H, -1);
//		for (int i = N-1; i >= 0; --i)
//			if (ON[i] == 0) {
//				long hc = HH[i]; // FR[i].hc;
//				if (!HMAP.containsKey(hc)) {
//					HMAP.put(hc, 1); // i);
//					//H[i] = -1;
//				} else {
//					HMAP.put(hc, HMAP.get(hc) + 1);
////					int j = HMAP.put(hc, i);
////					H[i] = j;
//				}
//			}
//		for (long v : HMAP.values())
//			cnt += v * (v-1) / 2;

//		for (int i = 0; i < N; ++i) {
//			if (H[i] > 0) {
////				Map<Profile, Integer> MAP = new HashMap<Profile, Integer>();
////				MAP.put(FR[i], 1);
//				long nn = 1L;
//				int j = i;
//				while (H[j] > 0) {
//					++nn;
//					int j2 = H[j]; H[j] = -1; j = j2;
////					if (!MAP.containsKey(FR[j]))
////						MAP.put(FR[j], 1);
////					else
////						MAP.put(FR[j], MAP.get(FR[j]) + 1);
//				}
////				for (long v : MAP.values())
////					cnt += v * (v - 1) / 2;
//				cnt += nn * (nn - 1) / 2;
//			}
//		}

		for (int i = 0; i < N; ++i)
			if (ON[i] == 0)
				//FR[i].hc = (FR[i].hc + 1L * (1+i) * (1+i) * (1+i)) % MOD;
				HH[i] = (HH[i] + 1L * (1+i) * (1+i) * (1+i)) % MOD;

		Z = new long [z];
		for (int i = 0, y = 0; i < N; ++i)
			if (ON[i] == 0)
				Z[y++] = HH[i];

		Arrays.sort(Z);
		for (int p = 0; p < z; ) {
			int q;
			for (q = p; q < z && Z[p] == Z[q]; ++q);
			long diff = q - p;
			cnt += diff * (diff - 1) / 2;
			p = q;
		}

//		HMAP = new HashMap<Long, Integer>();
//		H = new int [N];
//		Arrays.fill(H, -1);
//		for (int i = N-1; i >= 0; --i)
//			if (ON[i] == 0) {
//				long hc = HH[i]; // FR[i].hc;
//				if (!HMAP.containsKey(hc)) {
//					HMAP.put(hc, 1); // i);
//					//H[i] = -1;
//				} else {
//					HMAP.put(hc, HMAP.get(hc) + 1);
//					//int j = HMAP.put(hc, i);
//					//H[i] = j;
//				}
//			}
//		for (long v : HMAP.values())
//			cnt += v * (v-1) / 2;

//		for (int i = 0; i < N; ++i) {
//			if (H[i] > 0) {
//				Map<Profile, Integer> MAP = new HashMap<Profile, Integer>();
//				int j = i;
//				int last = ++FR[j].last;
//				if (FR[j].friends[last] == -1)
//					FR[j].friends[last] = j;
//				if (FR[j].friends[0] == -1)
//					for (int k = 1; k <= 1+last; ++k)
//						if (k <= last && FR[j].friends[k] < j)
//							FR[j].friends[k-1] = FR[j].friends[k];
//						else {
//							FR[j].friends[k-1] = j;
//							break;
//						}
//				MAP.put(FR[j], 1);
//				long nn = 1L;
//				while (H[j] > 0) {
//					++nn;
//					int j2 = H[j]; H[j] = -1; j = j2;
//					last = ++FR[j].last;
//					if (FR[j].friends[last] == -1)
//						FR[j].friends[last] = j;
//					if (FR[j].friends[0] == -1)
//						for (int k = 1; k <= last; ++k)
//							if (k <= last && FR[j].friends[k] < j)
//								FR[j].friends[k-1] = FR[j].friends[k];
//							else {
//								FR[j].friends[k-1] = j;
//								break;
//							}
//					if (!MAP.containsKey(FR[j]))
//						MAP.put(FR[j], 1);
//					else
//						MAP.put(FR[j], MAP.get(FR[j]) + 1);
//				}
//				for (long v : MAP.values())
//					cnt += v * (v - 1) / 2;
//				cnt += nn * (nn - 1) / 2;
//			}
//		}

		print(cnt);
	}

//	class Profile {
//		int last = -1;
//		final int id;
//		final int [] friends;
//		Profile (int i, int c) {
//			id = i;
//			friends = new int [1+c];
//			Arrays.fill(friends, -1);
//		}
//
//		long hc = 0;
////		public int hashCode() {
////			return hc;
////		}
//
//		boolean sorted = false;
//		public boolean equals(Object o) {
//			Profile p = (Profile)o;
//			if (p.last != last)
//				return false;
//
//			if (!sorted) {
//				Arrays.sort(friends);
//				sorted = true;
//			}
//			if (!p.sorted) {
//				Arrays.sort(p.friends);
//				p.sorted = true;
//			}
//
//			for (int i = 0; i <= last; ++i)
//				if (friends[i] != p.friends[i])
//					return false;
//			return true;
//		}
//
//		public String toString() {
//			return "#" + id + ": " + Arrays.toString(friends) + ", hc = " + hc;
//		}
//
//	}

	////////////////////////////////////////////////////////////////////////////////////

	static BufferedReader r;
	static long t;

	static void print2 (Object o) {
		System.out.println(o);
	}

	static void print (Object o) {
		print2(o);
		//print2((millis() - t) / 1000.0);
		System.exit(0);
	}

	static void run () throws IOException {
		r = new BufferedReader(new InputStreamReader(System.in));
		new C();
	}

	public static void main(String[] args) throws IOException {
		run();
	}

	static long millis() {
		return System.currentTimeMillis();
	}

	static void start() {
		t = millis();
	}
}


import java.io.*;
import java.math.*;
import java.util.*;

public class C {

	public C () throws IOException {
		String [] NM = r.readLine().split(" ");
		int N = Integer.parseInt(NM[0]);
		int M = Integer.parseInt(NM[1]);
		int [] F = new int [M], T = new int [M];
		for (int m = 0; m < M; ++m) {
			String [] ij = r.readLine().split(" ");
			int i = Integer.parseInt(ij[0]);
			int j = Integer.parseInt(ij[1]);
			F[m] = i-1;
			T[m] = j-1;
		}
		solve(N, M, F, T);
	}

	public void solve(int N, int M, int [] F, int [] T) {
		start();

		long [] H = new long [N], S = new long [N];
		long P = BigInteger.probablePrime(24, new Random()).intValue(), R = 1;

		for (int n = 0; n < N; ++n) {
			S[n] = R;
			R *= P;
		}

		for (int m = 0; m < M; ++m) {
			H[F[m]] += S[T[m]];
			H[T[m]] += S[F[m]];
		}

		long cnt = 0;
		long [] L = new long [N];
		for (int n = 0; n < N; ++n)
			L[n] = H[n] + S[n];

		for (int m = 0; m < M; ++m)
			if (L[F[m]] == L[T[m]])
				++cnt;

		Arrays.sort(H);
		long sz = 1;
		for (int p = 1; p < N; ++p) {
			if (H[p] == H[p-1])
				++sz;
			else {
				cnt += sz * (sz - 1) / 2;
				sz = 1;
			}
		}
		cnt += sz * (sz - 1) / 2;

		print(cnt);
	}

	////////////////////////////////////////////////////////////////////////////////////

	static BufferedReader r;
	static long t;

	static void print2 (Object o) {
		System.out.println(o);
	}

	static void print (Object o) {
		print2(o);
		//print2((millis() - t) / 1000.0);
		System.exit(0);
	}

	static void run () throws IOException {
		r = new BufferedReader(new InputStreamReader(System.in), 0x10000);
		new C();
	}

	public static void main(String[] args) throws IOException {
		run();
	}

	static long millis() {
		return System.currentTimeMillis();
	}

	static void start() {
		t = millis();
	}
}


import java.io.*;
import java.util.*;

public class C {

	long MILL = 1000000L;
	public C () throws IOException {
		String [] NM = r.readLine().split(" ");
		int N = Integer.parseInt(NM[0]);
		int M = Integer.parseInt(NM[1]);
		long [] F = new long [M];
		for (int m = 0; m < M; ++m) {
			String [] ij = r.readLine().split(" ");
			int i = Integer.parseInt(ij[0]);
			int j = Integer.parseInt(ij[1]);
			F[m] = MILL * (i-1) + (j-1);
		}
		solve(N, M, F);
	}

	public void solve(int N, int M, long [] F) {
		long cnt = s1(N, M, F, true);
		cnt += s1(N, M, F, false);
		print(cnt);
	}

	public long s1 (int N, int M, long [] F, boolean self) {
		start();

		int [] C = new int [N];
		for (int m = 0; m < M; ++m) {
			int i = (int)(F[m]/MILL), j = (int)(F[m]%MILL);
			++C[i]; ++C[j];
		}

		int [][] FR = new int [N][];
		for (int i = 0; i < N; ++i)
			FR[i] = new int[C[i] + (self ? 1 : 0)];

		Arrays.fill(C, 0);
		for (int m = 0; m < M; ++m) {
			int i = (int)(F[m]/MILL), j = (int)(F[m]%MILL);
			FR[i][C[i]] = j;
			FR[j][C[j]] = i;
			++C[i]; ++C[j];
		}

		long zero = 0, pairs = 0;

		if (self) {
			for (int i = 0; i < N; ++i) {
				if (C[i] == 0)
					++zero;
				if (C[i] == 1 && C[FR[i][0]] == 1)
					++pairs;
			}
			pairs /= 2;
		}

		if (self) {
			for (int i = 0; i < N; ++i)
				FR[i][C[i]] = i;
		}

		for (int i = 0; i < N; ++i)
			Arrays.sort(FR[i]);

		Map<String, Integer> MAP = new HashMap<String, Integer>();

		for (int i = 0; i < N; ++i) {
			if (C[i] >= 2) {
				String K = Arrays.toString(FR[i]);
				if (!MAP.containsKey(K))
					MAP.put(K, 0);
				MAP.put(K, MAP.get(K) + 1);
			}
		}

		long cnt = 0;
		for (long v : MAP.values())
			cnt += v*(v-1)/2;

		cnt += zero*(zero-1)/2 + pairs;
		return cnt;
	}

	////////////////////////////////////////////////////////////////////////////////////

	static BufferedReader r;
	static long t;

	static void print2 (Object o) {
		System.out.println(o);
	}

	static void print (Object o) {
		print2(o);
		//print2((millis() - t) / 1000.0);
		System.exit(0);
	}

	static void run () throws IOException {
		r = new BufferedReader(new InputStreamReader(System.in));
		new C();
	}

	public static void main(String[] args) throws IOException {
		run();
	}

	static long millis() {
		return System.currentTimeMillis();
	}

	static void start() {
		t = millis();
	}
}


import java.io.*;
import java.math.*;
import java.util.*;

public class C {

	public C () throws IOException {
		String [] NM = r.readLine().split(" ");
		int N = Integer.parseInt(NM[0]);
		int M = Integer.parseInt(NM[1]);
		int [] F = new int [M], T = new int [M];
		for (int m = 0; m < M; ++m) {
			String [] ij = r.readLine().split(" ");
			int i = Integer.parseInt(ij[0]);
			int j = Integer.parseInt(ij[1]);
			F[m] = i-1;
			T[m] = j-1;
		}
		solve(N, M, F, T);
	}

	public void solve(int N, int M, int [] F, int [] T) {
		start();

		long [] H = new long [N], S = new long [N];

		Random r = new Random();
		long p1 = BigInteger.probablePrime(48, r).longValue();
		long p2 = BigInteger.probablePrime(48, r).longValue();

		long r1 = 1, r2 = 1;
		for (int n = 0; n < N; ++n) {
			S[n] = r1 + r2;
			r1 *= p1;
			r2 *= p2;
		}

		for (int m = 0; m < M; ++m) {
			H[F[m]] += S[T[m]];
			H[T[m]] += S[F[m]];
		}

		long cnt = 0;
		long [] L = new long [N];
		for (int n = 0; n < N; ++n)
			L[n] = H[n] + S[n];

		for (int m = 0; m < M; ++m)
			if (L[F[m]] == L[T[m]])
				++cnt;

		Arrays.sort(H);
		long sz = 1;
		for (int p = 1; p < N; ++p) {
			if (H[p] == H[p-1])
				++sz;
			else {
				cnt += sz * (sz - 1) / 2;
				sz = 1;
			}
		}
		cnt += sz * (sz - 1) / 2;

		print(cnt);
	}

	////////////////////////////////////////////////////////////////////////////////////

	static BufferedReader r;
	static long t;

	static void print2 (Object o) {
		System.out.println(o);
	}

	static void print (Object o) {
		print2(o);
		//print2((millis() - t) / 1000.0);
		System.exit(0);
	}

	static void run () throws IOException {
		r = new BufferedReader(new InputStreamReader(System.in), 0x10000);
		new C();
	}

	public static void main(String[] args) throws IOException {
		run();
	}

	static long millis() {
		return System.currentTimeMillis();
	}

	static void start() {
		t = millis();
	}
}


import java.io.*;
import java.util.*;

public class C {

	public C () throws IOException {
		String [] NM = r.readLine().split(" ");
		int N = Integer.parseInt(NM[0]);
		int M = Integer.parseInt(NM[1]);
		int [] F = new int [M], T = new int [M];
		for (int m = 0; m < M; ++m) {
			String [] ij = r.readLine().split(" ");
			int i = Integer.parseInt(ij[0]);
			int j = Integer.parseInt(ij[1]);
			F[m] = i-1;
			T[m] = j-1;
		}
		solve(N, M, F, T);
	}

	public void solve(int N, int M, int [] F, int [] T) {
		start();

		int [] H = new int [N], S = new int [N];
		int P = 3, R = 1; // BigInteger.probablePrime(8, new Random()).longValue(), R = 1;

		for (int n = 0; n < N; ++n) {
			S[n] = R;
			R *= P;
		}

		for (int m = 0; m < M; ++m) {
			H[F[m]] += S[T[m]];
			H[T[m]] += S[F[m]];
		}

		long cnt = 0;
		long [] L = new long [N];
		for (int n = 0; n < N; ++n)
			L[n] = H[n] + S[n];

		for (int m = 0; m < M; ++m)
			if (L[F[m]] == L[T[m]])
				++cnt;

		Arrays.sort(H);
		long sz = 1;
		for (int p = 1; p < N; ++p) {
			if (H[p] == H[p-1])
				++sz;
			else {
				cnt += sz * (sz - 1) / 2;
				sz = 1;
			}
		}
		cnt += sz * (sz - 1) / 2;

		print(cnt);
	}

	////////////////////////////////////////////////////////////////////////////////////

	static BufferedReader r;
	static long t;

	static void print2 (Object o) {
		System.out.println(o);
	}

	static void print (Object o) {
		print2(o);
		//print2((millis() - t) / 1000.0);
		System.exit(0);
	}

	static void run () throws IOException {
		r = new BufferedReader(new InputStreamReader(System.in), 0x10000);
		new C();
	}

	public static void main(String[] args) throws IOException {
		run();
	}

	static long millis() {
		return System.currentTimeMillis();
	}

	static void start() {
		t = millis();
	}
}


import java.io.*;
import java.util.*;

public class C {

	public C () throws IOException {
		String [] NM = r.readLine().split(" ");
		int N = Integer.parseInt(NM[0]);
		int M = Integer.parseInt(NM[1]);
		int [][] F = new int [2][M];
		for (int m = 0; m < M; ++m) {
			String [] ij = r.readLine().split(" ");
			int i = Integer.parseInt(ij[0]);
			int j = Integer.parseInt(ij[1]);
			F[0][m] = i-1;
			F[1][m] = j-1;
		}
		solve(N, M, F);
	}

	public void solve(int N, int M, int [][] F) {
		start();

		int [] C = new int [N];
		int mc = 0;
		for (int m = 0; m < M; ++m) {
			int i = F[0][m], j = F[1][m];
			++C[i]; ++C[j];
			mc = Math.max(mc, Math.max(C[i], C[j]));
		}

		int [][] CN = new int [1+mc][];
		int [] QN = new int [1+mc];
		for (int i = 0; i < N; ++i)
			++QN[C[i]];
		for (int i = 0; i <= mc; ++i) {
			CN[i] = new int [QN[i]];
			QN[i] = 0;
		}

		for (int i = 0; i < N; ++i)
			CN[C[i]][QN[C[i]]++] = i;

		// C[i] - The degree of profile #i
		// CN[i] - The # of profiles of degree i

		long cnt = 1L * CN[0].length * (CN[0].length - 1)/2;

		if (N == C[0])
			print(cnt);

		int [] ON = new int [N];
		for (int m = 0; m < M; ++m) {
			int i = F[0][m], j = F[1][m];
			if (C[i] == 1)
				++ON[j];
			if (C[j] == 1)
				++ON[i];
		}

		// ON[i] - # of profiles of degree 1 that are connected with profile #i

		long pairs = 0;
		for (int i = 0; i < N; ++i) {
			if (C[i] == 0)
				ON[i] = -1;
			else if (ON[i] == 1) {
				if (C[i] == 1)
					++pairs;
				else
					cnt += 1L * ON[i] * (ON[i] - 1)/2;
			}
		}
		cnt += pairs/2;

		int B = 0;
		for (int i = 0; i < N; ++i)
			if (ON[i] != 0)
				++B;

		if (N == B)
			print(cnt);

		Profile [] FR = new Profile [N];
		for (int i = 0; i < N; ++i)
			if (ON[i] == 0)
				FR[i] = new Profile(i, C[i]);

		for (int m = 0; m < M; ++m) {
			int i = F[0][m], j = F[1][m];
			if (ON[i] == 0) {
				FR[i].friends[++FR[i].last] = j;
				FR[i].hc = (int)((FR[i].hc + 1L * (j+1) * (j+1) * (j+1)) % 1000000007);
			}
			if (ON[j] == 0) {
				FR[j].friends[++FR[j].last] = i;
				FR[j].hc = (int)((FR[j].hc + 1L * (i+1) * (i+1) * (i+1)) % 1000000007);
			}
		}

		Map<Integer, Integer> HMAP = new HashMap<Integer, Integer>();
		int [] H = new int [N];
		Arrays.fill(H, -1);
		for (int i = N-1; i >= 0; --i)
			if (ON[i] == 0) {
				int hc = FR[i].hc;
				if (!HMAP.containsKey(hc)) {
					HMAP.put(hc, i);
					H[i] = -1;
				} else {
					int j = HMAP.put(hc, i);
					H[i] = j;
				}
			}

		for (int i = 0; i < N; ++i) {
			if (H[i] > 0) {
				Map<Profile, Integer> MAP = new HashMap<Profile, Integer>();
				MAP.put(FR[i], 1);
				int j = i;
				while (H[j] > 0) {
					j = H[i];
					if (!MAP.containsKey(FR[j]))
						MAP.put(FR[j], 1);
					else
						MAP.put(FR[j], MAP.get(FR[j]) + 1);
				}
				for (long v : MAP.values())
					cnt += v * (v - 1) / 2;
			}
		}

		for (int i = 0; i < N; ++i)
			if (ON[i] == 0)
				FR[i].hc = (FR[i].hc + (1+i) * (1+i) * (1+i)) % 1000000007;

		HMAP = new HashMap<Integer, Integer>();
		H = new int [N];
		Arrays.fill(H, -1);
		for (int i = N-1; i >= 0; --i)
			if (ON[i] == 0) {
				int hc = FR[i].hc;
				if (!HMAP.containsKey(hc)) {
					HMAP.put(hc, i);
					H[i] = -1;
				} else {
					int j = HMAP.put(hc, i);
					H[i] = j;
				}
			}

		for (int i = 0; i < N; ++i) {
			if (H[i] > 0) {
				Map<Profile, Integer> MAP = new HashMap<Profile, Integer>();
				int j = i;
				if (FR[j].friends[++FR[j].last] == -1)
					FR[j].friends[FR[j].last] = j;
				if (FR[j].friends[0] == -1) {
					final int last = FR[j].last;
					for (int k = 1; k <= last; ++k)
						if (FR[j].friends[k] < j)
							FR[j].friends[k-1] = FR[j].friends[k];
						else {
							FR[j].friends[k-1] = j;
							break;
						}
				}
				MAP.put(FR[j], 1);
				while (H[j] > 0) {
					int j2 = H[j]; H[j] = -1; j = j2;
					if (FR[j].friends[++FR[j].last] == -1)
						FR[j].friends[FR[j].last] = j;
					if (FR[j].friends[0] == -1) {
						final int last = FR[j].last;
						for (int k = 1; k <= last; ++k)
							if (FR[j].friends[k] < j)
								FR[j].friends[k-1] = FR[j].friends[k];
							else {
								FR[j].friends[k-1] = j;
								break;
							}
					}
					if (!MAP.containsKey(FR[j]))
						MAP.put(FR[j], 1);
					else
						MAP.put(FR[j], MAP.get(FR[j]) + 1);
				}
				for (long v : MAP.values())
					cnt += v * (v - 1) / 2;
			}
		}

		print(cnt);
	}

	class Profile {
		int last = -1;
		final int id;
		final int [] friends;
		Profile (int i, int c) {
			id = i;
			friends = new int [1+c];
			Arrays.fill(friends, -1);
		}

		int hc = 0;
		public int hashCode() {
			return hc;
		}

		boolean sorted = false;
		public boolean equals(Object o) {
			Profile p = (Profile)o;
			if (p.last != last)
				return false;

			if (!sorted) {
				Arrays.sort(friends);
				sorted = true;
			}
			if (!p.sorted) {
				Arrays.sort(p.friends);
				p.sorted = true;
			}
			return Arrays.equals(friends, p.friends);
		}

		public String toString() {
			return "#" + id + ": " + Arrays.toString(friends) + ", hc = " + hc;
		}

	}

	////////////////////////////////////////////////////////////////////////////////////

	static BufferedReader r;
	static long t;

	static void print2 (Object o) {
		System.out.println(o);
	}

	static void print (Object o) {
		print2(o);
		//print2((millis() - t) / 1000.0);
		System.exit(0);
	}

	static void run () throws IOException {
		r = new BufferedReader(new InputStreamReader(System.in));
		new C();
	}

	public static void main(String[] args) throws IOException {
		run();
	}

	static long millis() {
		return System.currentTimeMillis();
	}

	static void start() {
		t = millis();
	}
}


import java.io.*;
import java.util.*;

public class C {

	public C () throws IOException {
		String [] NM = r.readLine().split(" ");
		int N = Integer.parseInt(NM[0]);
		int M = Integer.parseInt(NM[1]);
		int [][] F = new int [2][M];
		for (int m = 0; m < M; ++m) {
			String [] ij = r.readLine().split(" ");
			int i = Integer.parseInt(ij[0]);
			int j = Integer.parseInt(ij[1]);
			F[0][m] = i-1;
			F[1][m] = j-1;
		}
		solve(N, M, F);
	}

	public void solve(int N, int M, int [][] F) {
		start();

		int [] C = new int [N];
		int mc = 0;
		for (int m = 0; m < M; ++m) {
			int i = F[0][m], j = F[1][m];
			++C[i]; ++C[j];
			mc = Math.max(mc, Math.max(C[i], C[j]));
		}

		int [][] CN = new int [1+mc][];
		int [] QN = new int [1+mc];
		for (int i = 0; i < N; ++i)
			++QN[C[i]];
		for (int i = 0; i <= mc; ++i) {
			CN[i] = new int [QN[i]];
			QN[i] = 0;
		}

		for (int i = 0; i < N; ++i)
			CN[C[i]][QN[C[i]]++] = i;

		// C[i] - The degree of profile #i
		// CN[i] - The # of profiles of degree i

		long cnt = 1L * CN[0].length * (CN[0].length - 1)/2;

		if (N == C[0])
			print(cnt);

		int [] ON = new int [N];
		for (int m = 0; m < M; ++m) {
			int i = F[0][m], j = F[1][m];
			if (C[i] == 1)
				++ON[j];
			if (C[j] == 1)
				++ON[i];
		}

		// ON[i] - # of profiles of degree 1 that are connected with profile #i

		long pairs = 0;
		for (int i = 0; i < N; ++i) {
			if (C[i] == 0)
				ON[i] = -1;
			else if (ON[i] == 1) {
				if (C[i] == 1)
					++pairs;
				else
					cnt += 1L * ON[i] * (ON[i] - 1)/2;
			}
		}
		cnt += pairs/2;

		int B = 0;
		for (int i = 0; i < N; ++i)
			if (ON[i] != 0)
				++B;

		if (N == B)
			print(cnt);

		Profile [] FR = new Profile [N];
		for (int i = 0; i < N; ++i)
			if (ON[i] == 0)
				FR[i] = new Profile(i, C[i]);

		for (int m = 0; m < M; ++m) {
			int i = F[0][m], j = F[1][m];
			if (ON[i] == 0) {
				FR[i].friends[++FR[i].last] = j;
				FR[i].hc = (int)((FR[i].hc + 1L * (j+1) * (j+1) * (j+1)) % 1000000007);
			}
			if (ON[j] == 0) {
				FR[j].friends[++FR[j].last] = i;
				FR[j].hc = (int)((FR[j].hc + 1L * (i+1) * (i+1) * (i+1)) % 1000000007);
			}
		}

		Map<Integer, Integer> HMAP = new HashMap<Integer, Integer>();
		int [] H = new int [N];
		Arrays.fill(H, -1);
		for (int i = N-1; i >= 0; --i)
			if (ON[i] == 0) {
				int hc = FR[i].hc;
				if (!HMAP.containsKey(hc)) {
					HMAP.put(hc, i);
					H[i] = -1;
				} else {
					int j = HMAP.put(hc, i);
					H[i] = j;
				}
			}

		for (int i = 0; i < N; ++i) {
			if (H[i] > 0) {
				Map<Profile, Integer> MAP = new HashMap<Profile, Integer>();
				MAP.put(FR[i], 1);
				int j = i;
				while (H[j] > 0) {
					int j2 = H[j]; H[j] = -1; j = j2;
					if (!MAP.containsKey(FR[j]))
						MAP.put(FR[j], 1);
					else
						MAP.put(FR[j], MAP.get(FR[j]) + 1);
				}
				for (long v : MAP.values())
					cnt += v * (v - 1) / 2;
			}
		}

		for (int i = 0; i < N; ++i)
			if (ON[i] == 0)
				FR[i].hc = (FR[i].hc + (1+i) * (1+i) * (1+i)) % 1000000007;

		HMAP = new HashMap<Integer, Integer>();
		H = new int [N];
		Arrays.fill(H, -1);
		for (int i = N-1; i >= 0; --i)
			if (ON[i] == 0) {
				int hc = FR[i].hc;
				if (!HMAP.containsKey(hc)) {
					HMAP.put(hc, i);
					H[i] = -1;
				} else {
					int j = HMAP.put(hc, i);
					H[i] = j;
				}
			}

		for (int i = 0; i < N; ++i) {
			if (H[i] > 0) {
				Map<Profile, Integer> MAP = new HashMap<Profile, Integer>();
				int j = i;
				if (FR[j].friends[++FR[j].last] == -1)
					FR[j].friends[FR[j].last] = j;
				if (FR[j].friends[0] == -1) {
					final int last = FR[j].last;
					for (int k = 1; k <= last; ++k)
						if (FR[j].friends[k] < j)
							FR[j].friends[k-1] = FR[j].friends[k];
						else {
							FR[j].friends[k-1] = j;
							break;
						}
				}
				MAP.put(FR[j], 1);
				while (H[j] > 0) {
					int j2 = H[j]; H[j] = -1; j = j2;
					if (FR[j].friends[++FR[j].last] == -1)
						FR[j].friends[FR[j].last] = j;
					if (FR[j].friends[0] == -1) {
						final int last = FR[j].last;
						for (int k = 1; k <= last; ++k)
							if (FR[j].friends[k] < j)
								FR[j].friends[k-1] = FR[j].friends[k];
							else {
								FR[j].friends[k-1] = j;
								break;
							}
					}
					if (!MAP.containsKey(FR[j]))
						MAP.put(FR[j], 1);
					else
						MAP.put(FR[j], MAP.get(FR[j]) + 1);
				}
				for (long v : MAP.values())
					cnt += v * (v - 1) / 2;
			}
		}

		print(cnt);
	}

	class Profile {
		int last = -1;
		final int id;
		final int [] friends;
		Profile (int i, int c) {
			id = i;
			friends = new int [1+c];
			Arrays.fill(friends, -1);
		}

		int hc = 0;
		public int hashCode() {
			return hc;
		}

		boolean sorted = false;
		public boolean equals(Object o) {
			Profile p = (Profile)o;
			if (p.last != last)
				return false;

			if (!sorted) {
				Arrays.sort(friends);
				sorted = true;
			}
			if (!p.sorted) {
				Arrays.sort(p.friends);
				p.sorted = true;
			}
			return Arrays.equals(friends, p.friends);
		}

		public String toString() {
			return "#" + id + ": " + Arrays.toString(friends) + ", hc = " + hc;
		}

	}

	////////////////////////////////////////////////////////////////////////////////////

	static BufferedReader r;
	static long t;

	static void print2 (Object o) {
		System.out.println(o);
	}

	static void print (Object o) {
		print2(o);
		//print2((millis() - t) / 1000.0);
		System.exit(0);
	}

	static void run () throws IOException {
		r = new BufferedReader(new InputStreamReader(System.in));
		new C();
	}

	public static void main(String[] args) throws IOException {
		run();
	}

	static long millis() {
		return System.currentTimeMillis();
	}

	static void start() {
		t = millis();
	}
}


import java.io.*;
import java.util.*;

public class C {

	public C () throws IOException {
		String [] NM = r.readLine().split(" ");
		int N = Integer.parseInt(NM[0]);
		int M = Integer.parseInt(NM[1]);
		int [] F = new int [M], T = new int [M];
		for (int m = 0; m < M; ++m) {
			String [] ij = r.readLine().split(" ");
			int i = Integer.parseInt(ij[0]);
			int j = Integer.parseInt(ij[1]);
			F[m] = i-1;
			T[m] = j-1;
		}
		solve(N, M, F, T);
	}

	public void solve(int N, int M, int [] F, int [] T) {
		start();

		long [] HH = new long [N];
		long [] MM = new  long [N];

		for (int n = 0; n < N; ++n)
			MM[n] = (1L * (n+1) * (n+1) * (n+1));

		for (int m = 0; m < M; ++m) {
			HH[F[m]] += MM[T[m]];
			HH[T[m]] += MM[F[m]];
		}

		long cnt = 0;
		long [] LL = new long [N];
		for (int n = 0; n < N; ++n)
			LL[n] = HH[n] + MM[n];

		for (int m = 0; m < M; ++m)
			if (LL[F[m]] == LL[T[m]])
				++cnt;

		Arrays.sort(HH);
		long sz = 1;
		for (int p = 1; p < N; ++p) {
			if (HH[p] == HH[p-1])
				++sz;
			else {
				cnt += sz * (sz - 1) / 2;
				sz = 0;
			}
		}
		cnt += sz * (sz - 1) / 2;

		print(cnt);
	}

	////////////////////////////////////////////////////////////////////////////////////

	static BufferedReader r;
	static long t;

	static void print2 (Object o) {
		System.out.println(o);
	}

	static void print (Object o) {
		print2(o);
		//print2((millis() - t) / 1000.0);
		System.exit(0);
	}

	static void run () throws IOException {
		r = new BufferedReader(new InputStreamReader(System.in), 0x10000);
		new C();
	}

	public static void main(String[] args) throws IOException {
		run();
	}

	static long millis() {
		return System.currentTimeMillis();
	}

	static void start() {
		t = millis();
	}
}


import java.io.*;
import java.math.*;
import java.util.*;

public class C {

	public C () throws IOException {
		String [] NM = r.readLine().split(" ");
		int N = Integer.parseInt(NM[0]);
		int M = Integer.parseInt(NM[1]);
		int [] F = new int [M], T = new int [M];
		for (int m = 0; m < M; ++m) {
			String [] ij = r.readLine().split(" ");
			int i = Integer.parseInt(ij[0]);
			int j = Integer.parseInt(ij[1]);
			F[m] = i-1;
			T[m] = j-1;
		}
		solve(N, M, F, T);
	}

	public void solve(int N, int M, int [] F, int [] T) {
		start();

		long [] H = new long [N], S = new long [N];
		int P = BigInteger.probablePrime(24, new Random()).intValue(), R = 1;

		for (int n = 0; n < N; ++n) {
			S[n] = R;
			R *= P;
		}

		for (int m = 0; m < M; ++m) {
			H[F[m]] += S[T[m]];
			H[T[m]] += S[F[m]];
		}

		long cnt = 0;
		long [] L = new long [N];
		for (int n = 0; n < N; ++n)
			L[n] = H[n] + S[n];

		for (int m = 0; m < M; ++m)
			if (L[F[m]] == L[T[m]])
				++cnt;

		Arrays.sort(H);
		long sz = 1;
		for (int p = 1; p < N; ++p) {
			if (H[p] == H[p-1])
				++sz;
			else {
				cnt += sz * (sz - 1) / 2;
				sz = 1;
			}
		}
		cnt += sz * (sz - 1) / 2;

		print(cnt);
	}

	////////////////////////////////////////////////////////////////////////////////////

	static BufferedReader r;
	static long t;

	static void print2 (Object o) {
		System.out.println(o);
	}

	static void print (Object o) {
		print2(o);
		//print2((millis() - t) / 1000.0);
		System.exit(0);
	}

	static void run () throws IOException {
		r = new BufferedReader(new InputStreamReader(System.in), 0x10000);
		new C();
	}

	public static void main(String[] args) throws IOException {
		run();
	}

	static long millis() {
		return System.currentTimeMillis();
	}

	static void start() {
		t = millis();
	}
}


import java.io.*;
import java.math.*;
import java.util.*;

public class C {

	public C () throws IOException {
		String [] NM = r.readLine().split(" ");
		int N = Integer.parseInt(NM[0]);
		int M = Integer.parseInt(NM[1]);
		int [] F = new int [M], T = new int [M];
		for (int m = 0; m < M; ++m) {
			String [] ij = r.readLine().split(" ");
			int i = Integer.parseInt(ij[0]);
			int j = Integer.parseInt(ij[1]);
			F[m] = i-1;
			T[m] = j-1;
		}
		solve(N, M, F, T);
	}

	public void solve(int N, int M, int [] F, int [] T) {
		start();

		int [] H = new int [N], S = new int [N];
		int P = BigInteger.probablePrime(24, new Random()).intValue(), R = 1;

		for (int n = 0; n < N; ++n) {
			S[n] = R;
			R *= P;
		}

		for (int m = 0; m < M; ++m) {
			H[F[m]] += S[T[m]];
			H[T[m]] += S[F[m]];
		}

		long cnt = 0;
		long [] L = new long [N];
		for (int n = 0; n < N; ++n)
			L[n] = H[n] + S[n];

		for (int m = 0; m < M; ++m)
			if (L[F[m]] == L[T[m]])
				++cnt;

		Arrays.sort(H);
		long sz = 1;
		for (int p = 1; p < N; ++p) {
			if (H[p] == H[p-1])
				++sz;
			else {
				cnt += sz * (sz - 1) / 2;
				sz = 1;
			}
		}
		cnt += sz * (sz - 1) / 2;

		print(cnt);
	}

	////////////////////////////////////////////////////////////////////////////////////

	static BufferedReader r;
	static long t;

	static void print2 (Object o) {
		System.out.println(o);
	}

	static void print (Object o) {
		print2(o);
		//print2((millis() - t) / 1000.0);
		System.exit(0);
	}

	static void run () throws IOException {
		r = new BufferedReader(new InputStreamReader(System.in), 0x10000);
		new C();
	}

	public static void main(String[] args) throws IOException {
		run();
	}

	static long millis() {
		return System.currentTimeMillis();
	}

	static void start() {
		t = millis();
	}
}


import java.io.*;
import java.util.*;

public class C {

	public C () throws IOException {
		String [] NM = r.readLine().split(" ");
		int N = Integer.parseInt(NM[0]);
		int M = Integer.parseInt(NM[1]);
		int [][] F = new int [2][M];
		for (int m = 0; m < M; ++m) {
			String [] ij = r.readLine().split(" ");
			int i = Integer.parseInt(ij[0]);
			int j = Integer.parseInt(ij[1]);
			F[0][m] = i-1;
			F[1][m] = j-1;
		}
		solve(N, M, F);
	}

	public void solve(int N, int M, int [][] F) {
		start();

		int [] C = new int [N];
		int mc = 0;
		for (int m = 0; m < M; ++m) {
			int i = F[0][m], j = F[1][m];
			++C[i]; ++C[j];
			mc = Math.max(mc, Math.max(C[i], C[j]));
		}

		int [][] CN = new int [1+mc][];
		int [] QN = new int [1+mc];
		for (int i = 0; i < N; ++i)
			++QN[C[i]];
		for (int i = 0; i <= mc; ++i) {
			CN[i] = new int [QN[i]];
			QN[i] = 0;
		}

		for (int i = 0; i < N; ++i)
			CN[C[i]][QN[C[i]]++] = i;

		// C[i] - The degree of profile #i
		// CN[i] - The # of profiles of degree i

		long cnt = 1L * CN[0].length * (CN[0].length - 1)/2;

		if (N == C[0])
			print(cnt);

		int [] ON = new int [N];
		for (int m = 0; m < M; ++m) {
			int i = F[0][m], j = F[1][m];
			if (C[i] == 1)
				++ON[j];
			if (C[j] == 1)
				++ON[i];
		}

		// ON[i] - # of profiles of degree 1 that are connected with profile #i

		long pairs = 0;
		for (int i = 0; i < N; ++i) {
			if (C[i] == 0)
				ON[i] = -1;
			else if (ON[i] == 1) {
				if (C[i] == 1)
					++pairs;
				else
					cnt += 1L * ON[i] * (ON[i] - 1)/2;
			}
		}
		cnt += pairs/2;

		int B = 0;
		for (int i = 0; i < N; ++i)
			if (ON[i] != 0)
				++B;

		if (N == B)
			print(cnt);

		Profile [] FR = new Profile [N];
		for (int i = 0; i < N; ++i)
			if (ON[i] == 0)
				FR[i] = new Profile(i, C[i]);

		long MOD = 1000000000000000007L;

		for (int m = 0; m < M; ++m) {
			int i = F[0][m], j = F[1][m];
			if (ON[i] == 0) {
				FR[i].friends[++FR[i].last] = j;
				FR[i].hc = (FR[i].hc + 1L * (j+1) * (j+1) * (j+1)) % MOD;
			}
			if (ON[j] == 0) {
				FR[j].friends[++FR[j].last] = i;
				FR[j].hc = (FR[j].hc + 1L * (i+1) * (i+1) * (i+1)) % MOD;
			}
		}

		Map<Long, Integer> HMAP = new HashMap<Long, Integer>();
		int [] H = new int [N];
		Arrays.fill(H, -1);
		for (int i = N-1; i >= 0; --i)
			if (ON[i] == 0) {
				long hc = FR[i].hc;
				if (!HMAP.containsKey(hc)) {
					HMAP.put(hc, i);
					H[i] = -1;
				} else {
					int j = HMAP.put(hc, i);
					H[i] = j;
				}
			}

		for (int i = 0; i < N; ++i) {
			if (H[i] > 0) {
//				Map<Profile, Integer> MAP = new HashMap<Profile, Integer>();
//				MAP.put(FR[i], 1);
				long nn = 1L;
				int j = i;
				while (H[j] > 0) {
					++nn;
					int j2 = H[j]; H[j] = -1; j = j2;
//					if (!MAP.containsKey(FR[j]))
//						MAP.put(FR[j], 1);
//					else
//						MAP.put(FR[j], MAP.get(FR[j]) + 1);
				}
//				for (long v : MAP.values())
//					cnt += v * (v - 1) / 2;
				cnt += nn * (nn - 1) / 2;
			}
		}

		for (int i = 0; i < N; ++i)
			if (ON[i] == 0)
				FR[i].hc = (FR[i].hc + 1L * (1+i) * (1+i) * (1+i)) % MOD;

		HMAP = new HashMap<Long, Integer>();
		H = new int [N];
		Arrays.fill(H, -1);
		for (int i = N-1; i >= 0; --i)
			if (ON[i] == 0) {
				long hc = FR[i].hc;
				if (!HMAP.containsKey(hc)) {
					HMAP.put(hc, i);
					H[i] = -1;
				} else {
					int j = HMAP.put(hc, i);
					H[i] = j;
				}
			}

		for (int i = 0; i < N; ++i) {
			if (H[i] > 0) {
//				Map<Profile, Integer> MAP = new HashMap<Profile, Integer>();
				int j = i;
//				int last = ++FR[j].last;
//				if (FR[j].friends[last] == -1)
//					FR[j].friends[last] = j;
//				if (FR[j].friends[0] == -1)
//					for (int k = 1; k <= 1+last; ++k)
//						if (k <= last && FR[j].friends[k] < j)
//							FR[j].friends[k-1] = FR[j].friends[k];
//						else {
//							FR[j].friends[k-1] = j;
//							break;
//						}
//				MAP.put(FR[j], 1);
				long nn = 1L;
				while (H[j] > 0) {
					++nn;
					int j2 = H[j]; H[j] = -1; j = j2;
//					last = ++FR[j].last;
//					if (FR[j].friends[last] == -1)
//						FR[j].friends[last] = j;
//					if (FR[j].friends[0] == -1)
//						for (int k = 1; k <= last; ++k)
//							if (k <= last && FR[j].friends[k] < j)
//								FR[j].friends[k-1] = FR[j].friends[k];
//							else {
//								FR[j].friends[k-1] = j;
//								break;
//							}
//					if (!MAP.containsKey(FR[j]))
//						MAP.put(FR[j], 1);
//					else
//						MAP.put(FR[j], MAP.get(FR[j]) + 1);
				}
//				for (long v : MAP.values())
//					cnt += v * (v - 1) / 2;
				cnt += nn * (nn - 1) / 2;
			}
		}

		print(cnt);
	}

	class Profile {
		int last = -1;
		final int id;
		final int [] friends;
		Profile (int i, int c) {
			id = i;
			friends = new int [1+c];
			Arrays.fill(friends, -1);
		}

		long hc = 0;
//		public int hashCode() {
//			return hc;
//		}

		boolean sorted = false;
		public boolean equals(Object o) {
			Profile p = (Profile)o;
			if (p.last != last)
				return false;

			if (!sorted) {
				Arrays.sort(friends);
				sorted = true;
			}
			if (!p.sorted) {
				Arrays.sort(p.friends);
				p.sorted = true;
			}

			for (int i = 0; i <= last; ++i)
				if (friends[i] != p.friends[i])
					return false;
			return true;
		}

		public String toString() {
			return "#" + id + ": " + Arrays.toString(friends) + ", hc = " + hc;
		}

	}

	////////////////////////////////////////////////////////////////////////////////////

	static BufferedReader r;
	static long t;

	static void print2 (Object o) {
		System.out.println(o);
	}

	static void print (Object o) {
		print2(o);
		//print2((millis() - t) / 1000.0);
		System.exit(0);
	}

	static void run () throws IOException {
		r = new BufferedReader(new InputStreamReader(System.in));
		new C();
	}

	public static void main(String[] args) throws IOException {
		run();
	}

	static long millis() {
		return System.currentTimeMillis();
	}

	static void start() {
		t = millis();
	}
}


import java.io.*;
import java.util.*;

public class C {

	long MILL = 1000000L;

	public C () throws IOException {
		String [] NM = r.readLine().split(" ");
		int N = Integer.parseInt(NM[0]);
		int M = Integer.parseInt(NM[1]);
		long [] F = new long [M];
		for (int m = 0; m < M; ++m) {
			String [] ij = r.readLine().split(" ");
			int i = Integer.parseInt(ij[0]);
			int j = Integer.parseInt(ij[1]);
			F[m] = MILL * (i-1) + (j-1);
		}
		solve(N, M, F);
	}

	public void solve(int N, int M, long [] F) {
		long cnt = s1(N, M, F);
		F = Arrays.copyOf(F, M+N);
		for (int i = 0; i < N; ++i)
			F[M+i] = (1+MILL) * i;
		cnt += s1(N, M+N, F);
		//return cnt;
		print(cnt);
	}

	public long s1 (int N, int M, long [] F) {
		start();

		final int [] C = new int [N];
		for (int m = 0; m < M; ++m) {
			int i = (int)(F[m]/MILL), j = (int)(F[m]%MILL);
			++C[i];
			if (i != j)
				++C[j];
		}

		int [][] FR = new int [N][];
		for (int i = 0; i < N; ++i)
			FR[i] = new int[C[i]];

		Arrays.fill(C, 0);
		for (int m = 0; m < M; ++m) {
			int i = (int)(F[m]/MILL), j = (int)(F[m]%MILL);
			FR[i][C[i]++] = j;
			if (i != j)
				FR[j][C[j]++] = i;
		}

		for (int i = 0; i < N; ++i)
			if (C[i] >= 2)
				Arrays.sort(FR[i]);

		final int [] H = new int [N];
		for (int i = 0; i < N; ++i)
			for (int j = 0; j < C[i]; ++j)
				H[i] = (int)((H[i] * 37L + FR[i][j]) % 1000000007L);

		Integer [] FF = new Integer [N];
		for (int i = 0; i < N; ++i)
			FF[i] = i;

		Arrays.sort(FF, new Comparator<Integer>() {
			public int compare(Integer arg0, Integer arg1) {
				if (C[arg0] != C[arg1])
					return C[arg0] - C[arg1];
				else
					return H[arg0] - H[arg1];
			}
		});

		int p;
		for (p = 0; p < N; ++p) {
			int pp = FF[p];
			if (C[pp] > 0)
				break;
		}

		long cnt = p*(p-1)/2;

		for (; p < N; ) {
			int pp = FF[p], q;
			for (q = p; q < N; ++q) {
				int qq = FF[q];
				if (C[qq] != C[pp] || H[qq] != H[pp])
					break;
			}
			if (q - p > 1) {
				Map<String, Integer> MAP = new HashMap<String, Integer>();
				for (int i = p; i < q; ++i) {
					int ii = FF[i];
					String K = Arrays.toString(FR[ii]);
					if (!MAP.containsKey(K))
						MAP.put(K, 0);
					MAP.put(K, MAP.get(K) + 1);
				}
				for (long v: MAP.values())
					cnt += v*(v-1)/2;
			}
			p = q;
		}

		return cnt;
	}

	////////////////////////////////////////////////////////////////////////////////////

	static BufferedReader r;
	static long t;

	static void print2 (Object o) {
		System.out.println(o);
	}

	static void print (Object o) {
		print2(o);
		//print2((millis() - t) / 1000.0);
		System.exit(0);
	}

	static void run () throws IOException {
		r = new BufferedReader(new InputStreamReader(System.in));
		new C();
	}

	public static void main(String[] args) throws IOException {
		run();
	}

	static long millis() {
		return System.currentTimeMillis();
	}

	static void start() {
		t = millis();
	}
}


import java.io.*;
import java.util.*;

public class C {

	long MILL = 1000000L;

	public C () throws IOException {
		String [] NM = r.readLine().split(" ");
		int N = Integer.parseInt(NM[0]);
		int M = Integer.parseInt(NM[1]);
		long [] F = new long [M];
		for (int m = 0; m < M; ++m) {
			String [] ij = r.readLine().split(" ");
			int i = Integer.parseInt(ij[0]);
			int j = Integer.parseInt(ij[1]);
			F[m] = MILL * (i-1) + (j-1);
		}
		solve(N, M, F);
	}

	public void solve(int N, int M, long [] F) {
		long cnt = s1(N, M, F);
		F = Arrays.copyOf(F, M+N);
		for (int i = 0; i < N; ++i)
			F[M+i] = (1+MILL) * i;
		cnt += s1(N, M+N, F);
		//return cnt;
		print(cnt);
	}

	public long s1 (int N, int M, long [] F) {
		start();

		final int [] C = new int [N];
		for (int m = 0; m < M; ++m) {
			int i = (int)(F[m]/MILL), j = (int)(F[m]%MILL);
			++C[i];
			if (i != j)
				++C[j];
		}

		int [][] FR = new int [N][];
		for (int i = 0; i < N; ++i)
			FR[i] = new int[C[i]];

		Arrays.fill(C, 0);
		for (int m = 0; m < M; ++m) {
			int i = (int)(F[m]/MILL), j = (int)(F[m]%MILL);
			FR[i][C[i]++] = j;
			if (i != j)
				FR[j][C[j]++] = i;
		}

		for (int i = 0; i < N; ++i)
			if (C[i] >= 2)
				Arrays.sort(FR[i]);

		final int [] H = new int [N];
		for (int i = 0; i < N; ++i)
			for (int j = 0; j < C[i]; ++j)
				H[i] = (int)((H[i] * 37L + FR[i][j]) % 1000000007L);

		Integer [] FF = new Integer [N];
		for (int i = 0; i < N; ++i)
			FF[i] = i;

		Arrays.sort(FF, new Comparator<Integer>() {
			public int compare(Integer arg0, Integer arg1) {
				if (C[arg0] != C[arg1])
					return C[arg0] - C[arg1];
				else
					return H[arg0] - H[arg1];
			}
		});

		int p;
		for (p = 0; p < N; ++p) {
			int pp = FF[p];
			if (C[pp] > 0)
				break;
		}

		long cnt = 1L*p*(p-1)/2;

		for (; p < N; ) {
			int pp = FF[p], q;
			for (q = p; q < N; ++q) {
				int qq = FF[q];
				if (C[qq] != C[pp] || H[qq] != H[pp])
					break;
			}
			if (q - p > 1) {
				long v = q - p;
				cnt += v*(v-1)/2;

//				Map<String, Integer> MAP = new HashMap<String, Integer>();
//				for (int i = p; i < q; ++i) {
//					int ii = FF[i];
//					String K = toString(FR[ii]);
//					if (!MAP.containsKey(K))
//						MAP.put(K, 0);
//					MAP.put(K, MAP.get(K) + 1);
//				}
//				for (long v: MAP.values())
//					cnt += v*(v-1)/2;
			}
			p = q;
		}

		return cnt;
	}

	String toString(int [] FR) {
		StringBuffer b = new StringBuffer();
		for (int f : FR)
			b.append(":" + f);
		return b.toString();
	}

	////////////////////////////////////////////////////////////////////////////////////

	static BufferedReader r;
	static long t;

	static void print2 (Object o) {
		System.out.println(o);
	}

	static void print (Object o) {
		print2(o);
		//print2((millis() - t) / 1000.0);
		System.exit(0);
	}

	static void run () throws IOException {
		r = new BufferedReader(new InputStreamReader(System.in));
		new C();
	}

	public static void main(String[] args) throws IOException {
		run();
	}

	static long millis() {
		return System.currentTimeMillis();
	}

	static void start() {
		t = millis();
	}
}


import java.io.*;
import java.util.*;

public class C {

	public C () throws IOException {
		String [] NM = r.readLine().split(" ");
		int N = Integer.parseInt(NM[0]);
		int M = Integer.parseInt(NM[1]);
		int [][] F = new int [2][M];
		for (int m = 0; m < M; ++m) {
			String [] ij = r.readLine().split(" ");
			int i = Integer.parseInt(ij[0]);
			int j = Integer.parseInt(ij[1]);
			F[0][m] = i-1;
			F[1][m] = j-1;
		}
		solve(N, M, F);
	}

	public void solve(int N, int M, int [][] F) {
		start();

		int [] C = new int [N];
		int mc = 0;
		for (int m = 0; m < M; ++m) {
			int i = F[0][m], j = F[1][m];
			++C[i]; ++C[j];
			mc = Math.max(mc, Math.max(C[i], C[j]));
		}

		int [][] CN = new int [1+mc][];
		int [] QN = new int [1+mc];
		for (int i = 0; i < N; ++i)
			++QN[C[i]];
		for (int i = 0; i <= mc; ++i) {
			CN[i] = new int [QN[i]];
			QN[i] = 0;
		}

		for (int i = 0; i < N; ++i)
			CN[C[i]][QN[C[i]]++] = i;

		// C[i] - The degree of profile #i
		// CN[i] - The # of profiles of degree i

		long cnt = 1L * CN[0].length * (CN[0].length - 1)/2;

		if (N == C[0])
			print(cnt);

		int [] ON = new int [N];
		for (int m = 0; m < M; ++m) {
			int i = F[0][m], j = F[1][m];
			if (C[i] == 1)
				++ON[j];
			if (C[j] == 1)
				++ON[i];
		}

		// ON[i] - # of profiles of degree 1 that are connected with profile #i

		long pairs = 0;
		for (int i = 0; i < N; ++i) {
			if (C[i] == 0)
				ON[i] = -1;
			else if (ON[i] == 1) {
				if (C[i] == 1)
					++pairs;
				else
					cnt += 1L * ON[i] * (ON[i] - 1)/2;
			}
		}
		cnt += pairs/2;

		int B = 0;
		for (int i = 0; i < N; ++i)
			if (ON[i] != 0)
				++B;

		if (N == B)
			print(cnt);

		Profile [] FR = new Profile [N];
		for (int i = 0; i < N; ++i)
			if (ON[i] == 0)
				FR[i] = new Profile(i, C[i]);

		for (int m = 0; m < M; ++m) {
			int i = F[0][m], j = F[1][m];
			if (ON[i] == 0) {
				FR[i].friends[++FR[i].last] = j;
				FR[i].hc = (int)((FR[i].hc + 1L * (j+1) * (j+1) * (j+1)) % 1000000007);
			}
			if (ON[j] == 0) {
				FR[j].friends[++FR[j].last] = i;
				FR[j].hc = (int)((FR[j].hc + 1L * (i+1) * (i+1) * (i+1)) % 1000000007);
			}
		}

		Map<Integer, Integer> HMAP = new HashMap<Integer, Integer>();
		int [] H = new int [N];
		Arrays.fill(H, -1);
		for (int i = N-1; i >= 0; --i)
			if (ON[i] == 0) {
				int hc = FR[i].hc;
				if (!HMAP.containsKey(hc)) {
					HMAP.put(hc, i);
					H[i] = -1;
				} else {
					int j = HMAP.put(hc, i);
					H[i] = j;
				}
			}

		for (int i = 0; i < N; ++i) {
			if (H[i] > 0) {
				Map<Profile, Integer> MAP = new HashMap<Profile, Integer>();
				MAP.put(FR[i], 1);
				int j = i;
				while (H[j] > 0) {
					int j2 = H[j]; H[j] = -1; j = j2;
					if (!MAP.containsKey(FR[j]))
						MAP.put(FR[j], 1);
					else
						MAP.put(FR[j], MAP.get(FR[j]) + 1);
				}
				for (long v : MAP.values())
					cnt += v * (v - 1) / 2;
			}
		}

		for (int i = 0; i < N; ++i)
			if (ON[i] == 0)
				FR[i].hc = (int)((FR[i].hc + 1L * (1+i) * (1+i) * (1+i)) % 1000000007);

		HMAP = new HashMap<Integer, Integer>();
		H = new int [N];
		Arrays.fill(H, -1);
		for (int i = N-1; i >= 0; --i)
			if (ON[i] == 0) {
				int hc = FR[i].hc;
				if (!HMAP.containsKey(hc)) {
					HMAP.put(hc, i);
					H[i] = -1;
				} else {
					int j = HMAP.put(hc, i);
					H[i] = j;
				}
			}

		for (int i = 0; i < N; ++i) {
			if (H[i] > 0) {
				Map<Profile, Integer> MAP = new HashMap<Profile, Integer>();
				int j = i;
				int last = ++FR[j].last;
				if (FR[j].friends[last] == -1)
					FR[j].friends[last] = j;
				if (FR[j].friends[0] == -1)
					for (int k = 1; k <= 1+last; ++k)
						if (k <= last && FR[j].friends[k] < j)
							FR[j].friends[k-1] = FR[j].friends[k];
						else {
							FR[j].friends[k-1] = j;
							break;
						}
				MAP.put(FR[j], 1);
				while (H[j] > 0) {
					int j2 = H[j]; H[j] = -1; j = j2;
					last = ++FR[j].last;
					if (FR[j].friends[last] == -1)
						FR[j].friends[last] = j;
					if (FR[j].friends[0] == -1)
						for (int k = 1; k <= last; ++k)
							if (k <= last && FR[j].friends[k] < j)
								FR[j].friends[k-1] = FR[j].friends[k];
							else {
								FR[j].friends[k-1] = j;
								break;
							}
					if (!MAP.containsKey(FR[j]))
						MAP.put(FR[j], 1);
					else
						MAP.put(FR[j], MAP.get(FR[j]) + 1);
				}
				for (long v : MAP.values())
					cnt += v * (v - 1) / 2;
			}
		}

		print(cnt);
	}

	class Profile {
		int last = -1;
		final int id;
		final int [] friends;
		Profile (int i, int c) {
			id = i;
			friends = new int [1+c];
			Arrays.fill(friends, -1);
		}

		int hc = 0;
		public int hashCode() {
			return hc;
		}

		boolean sorted = false;
		public boolean equals(Object o) {
			Profile p = (Profile)o;
			if (p.last != last)
				return false;

			if (!sorted) {
				Arrays.sort(friends);
				sorted = true;
			}
			if (!p.sorted) {
				Arrays.sort(p.friends);
				p.sorted = true;
			}

			for (int i = 0; i <= last; ++i)
				if (friends[i] != p.friends[i])
					return false;
			return true;
		}

		public String toString() {
			return "#" + id + ": " + Arrays.toString(friends) + ", hc = " + hc;
		}

	}

	////////////////////////////////////////////////////////////////////////////////////

	static BufferedReader r;
	static long t;

	static void print2 (Object o) {
		System.out.println(o);
	}

	static void print (Object o) {
		print2(o);
		//print2((millis() - t) / 1000.0);
		System.exit(0);
	}

	static void run () throws IOException {
		r = new BufferedReader(new InputStreamReader(System.in));
		new C();
	}

	public static void main(String[] args) throws IOException {
		run();
	}

	static long millis() {
		return System.currentTimeMillis();
	}

	static void start() {
		t = millis();
	}
}


import java.io.*;
import java.util.*;

public class C {

	public C () throws IOException {
		String [] NM = r.readLine().split(" ");
		int N = Integer.parseInt(NM[0]);
		int M = Integer.parseInt(NM[1]);
		int [][] F = new int [2][M];
		for (int m = 0; m < M; ++m) {
			String [] ij = r.readLine().split(" ");
			int i = Integer.parseInt(ij[0]);
			int j = Integer.parseInt(ij[1]);
			F[0][m] = i-1;
			F[1][m] = j-1;
		}
		solve(N, M, F);
	}

	public void solve(int N, int M, int [][] F) {
		start();

		int [] C = new int [N];
		int mc = 0;
		for (int m = 0; m < M; ++m) {
			int i = F[0][m], j = F[1][m];
			++C[i]; ++C[j];
			mc = Math.max(mc, Math.max(C[i], C[j]));
		}

		int [][] CN = new int [1+mc][];
		int [] QN = new int [1+mc];
		for (int i = 0; i < N; ++i)
			++QN[C[i]];
		for (int i = 0; i <= mc; ++i) {
			CN[i] = new int [QN[i]];
			QN[i] = 0;
		}

		for (int i = 0; i < N; ++i)
			CN[C[i]][QN[C[i]]++] = i;

		// C[i] - The degree of profile #i
		// CN[i] - The # of profiles of degree i

		long cnt = 1L * CN[0].length * (CN[0].length - 1)/2;

		if (N == C[0])
			print(cnt);

		int [] ON = new int [N];
		for (int m = 0; m < M; ++m) {
			int i = F[0][m], j = F[1][m];
			if (C[i] == 1)
				++ON[j];
			if (C[j] == 1)
				++ON[i];
		}

		// ON[i] - # of profiles of degree 1 that are connected with profile #i

		long pairs = 0;
		for (int i = 0; i < N; ++i) {
			if (C[i] == 0)
				ON[i] = -1;
			else if (ON[i] == 1) {
				if (C[i] == 1)
					++pairs;
				else
					cnt += 1L * ON[i] * (ON[i] - 1)/2;
			}
		}
		cnt += pairs/2;

		int B = 0;
		for (int i = 0; i < N; ++i)
			if (ON[i] != 0)
				++B;

		if (N == B)
			print(cnt);

		int z = N-B;

//		Profile [] FR = new Profile [N];
//		for (int i = 0; i < N; ++i)
//			if (ON[i] == 0)
//				FR[i] = new Profile(i, C[i]);

//		int [][] FR = new int [N][];
//		for (int i = 0; i < N; ++i)
//			if (ON[i] == 0) {
//				FR[i] = new int [1+C[i]];
//				Arrays.fill(FR[i], -1);
//			}

		long MOD = 1000000000000000007L;

//		for (int m = 0; m < M; ++m) {
//		int i = F[0][m], j = F[1][m];
//		if (ON[i] == 0) {
//			FR[i].friends[++FR[i].last] = j;
//			FR[i].hc = (FR[i].hc + 1L * (j+1) * (j+1) * (j+1)) % MOD;
//		}
//		if (ON[j] == 0) {
//			FR[j].friends[++FR[j].last] = i;
//			FR[j].hc = (FR[j].hc + 1L * (i+1) * (i+1) * (i+1)) % MOD;
//		}
//	}

		long [] HH = new long [N];

		Arrays.fill(C, 0);
		for (int m = 0; m < M; ++m) {
			int i = F[0][m], j = F[1][m];
			if (ON[i] == 0) {
//				FR[i][C[i]++] = j;
				HH[i] = (HH[i] + 1L * (j+1) * (j+1) * (j+1)) % MOD;
			}
			if (ON[j] == 0) {
//				FR[j][C[j]++] = i;
				HH[j] = (HH[j] + 1L * (i+1) * (i+1) * (i+1)) % MOD;
		}
	}

		long [] Z = new long [z];
		for (int i = 0, y = 0; i < N; ++i)
			if (ON[i] == 0)
				Z[y++] = HH[i];

		Arrays.sort(Z);
		for (int p = 0; p < z; ) {
			int q;
			for (q = p; Z[p] == Z[q]; ++q);
			long diff = q - p;
			cnt += diff * (diff - 1) / 2;
			p = q;
		}

//		Map<Long, Integer> HMAP = new HashMap<Long, Integer>();
////		int [] H = new int [N];
////		Arrays.fill(H, -1);
//		for (int i = N-1; i >= 0; --i)
//			if (ON[i] == 0) {
//				long hc = HH[i]; // FR[i].hc;
//				if (!HMAP.containsKey(hc)) {
//					HMAP.put(hc, 1); // i);
//					//H[i] = -1;
//				} else {
//					HMAP.put(hc, HMAP.get(hc) + 1);
////					int j = HMAP.put(hc, i);
////					H[i] = j;
//				}
//			}
//		for (long v : HMAP.values())
//			cnt += v * (v-1) / 2;

//		for (int i = 0; i < N; ++i) {
//			if (H[i] > 0) {
////				Map<Profile, Integer> MAP = new HashMap<Profile, Integer>();
////				MAP.put(FR[i], 1);
//				long nn = 1L;
//				int j = i;
//				while (H[j] > 0) {
//					++nn;
//					int j2 = H[j]; H[j] = -1; j = j2;
////					if (!MAP.containsKey(FR[j]))
////						MAP.put(FR[j], 1);
////					else
////						MAP.put(FR[j], MAP.get(FR[j]) + 1);
//				}
////				for (long v : MAP.values())
////					cnt += v * (v - 1) / 2;
//				cnt += nn * (nn - 1) / 2;
//			}
//		}

		for (int i = 0; i < N; ++i)
			if (ON[i] == 0)
				//FR[i].hc = (FR[i].hc + 1L * (1+i) * (1+i) * (1+i)) % MOD;
				HH[i] = (HH[i] + 1L * (1+i) * (1+i) * (1+i)) % MOD;

		Z = new long [z];
		for (int i = 0, y = 0; i < N; ++i)
			if (ON[i] == 0)
				Z[y++] = HH[i];

		Arrays.sort(Z);
		for (int p = 0; p < z; ) {
			int q;
			for (q = p; Z[p] == Z[q]; ++q);
			long diff = q - p;
			cnt += diff * (diff - 1) / 2;
			p = q;
		}

//		HMAP = new HashMap<Long, Integer>();
//		H = new int [N];
//		Arrays.fill(H, -1);
//		for (int i = N-1; i >= 0; --i)
//			if (ON[i] == 0) {
//				long hc = HH[i]; // FR[i].hc;
//				if (!HMAP.containsKey(hc)) {
//					HMAP.put(hc, 1); // i);
//					//H[i] = -1;
//				} else {
//					HMAP.put(hc, HMAP.get(hc) + 1);
//					//int j = HMAP.put(hc, i);
//					//H[i] = j;
//				}
//			}
//		for (long v : HMAP.values())
//			cnt += v * (v-1) / 2;

//		for (int i = 0; i < N; ++i) {
//			if (H[i] > 0) {
//				Map<Profile, Integer> MAP = new HashMap<Profile, Integer>();
//				int j = i;
//				int last = ++FR[j].last;
//				if (FR[j].friends[last] == -1)
//					FR[j].friends[last] = j;
//				if (FR[j].friends[0] == -1)
//					for (int k = 1; k <= 1+last; ++k)
//						if (k <= last && FR[j].friends[k] < j)
//							FR[j].friends[k-1] = FR[j].friends[k];
//						else {
//							FR[j].friends[k-1] = j;
//							break;
//						}
//				MAP.put(FR[j], 1);
//				long nn = 1L;
//				while (H[j] > 0) {
//					++nn;
//					int j2 = H[j]; H[j] = -1; j = j2;
//					last = ++FR[j].last;
//					if (FR[j].friends[last] == -1)
//						FR[j].friends[last] = j;
//					if (FR[j].friends[0] == -1)
//						for (int k = 1; k <= last; ++k)
//							if (k <= last && FR[j].friends[k] < j)
//								FR[j].friends[k-1] = FR[j].friends[k];
//							else {
//								FR[j].friends[k-1] = j;
//								break;
//							}
//					if (!MAP.containsKey(FR[j]))
//						MAP.put(FR[j], 1);
//					else
//						MAP.put(FR[j], MAP.get(FR[j]) + 1);
//				}
//				for (long v : MAP.values())
//					cnt += v * (v - 1) / 2;
//				cnt += nn * (nn - 1) / 2;
//			}
//		}

		print(cnt);
	}

//	class Profile {
//		int last = -1;
//		final int id;
//		final int [] friends;
//		Profile (int i, int c) {
//			id = i;
//			friends = new int [1+c];
//			Arrays.fill(friends, -1);
//		}
//
//		long hc = 0;
////		public int hashCode() {
////			return hc;
////		}
//
//		boolean sorted = false;
//		public boolean equals(Object o) {
//			Profile p = (Profile)o;
//			if (p.last != last)
//				return false;
//
//			if (!sorted) {
//				Arrays.sort(friends);
//				sorted = true;
//			}
//			if (!p.sorted) {
//				Arrays.sort(p.friends);
//				p.sorted = true;
//			}
//
//			for (int i = 0; i <= last; ++i)
//				if (friends[i] != p.friends[i])
//					return false;
//			return true;
//		}
//
//		public String toString() {
//			return "#" + id + ": " + Arrays.toString(friends) + ", hc = " + hc;
//		}
//
//	}

	////////////////////////////////////////////////////////////////////////////////////

	static BufferedReader r;
	static long t;

	static void print2 (Object o) {
		System.out.println(o);
	}

	static void print (Object o) {
		print2(o);
		//print2((millis() - t) / 1000.0);
		System.exit(0);
	}

	static void run () throws IOException {
		r = new BufferedReader(new InputStreamReader(System.in));
		new C();
	}

	public static void main(String[] args) throws IOException {
		run();
	}

	static long millis() {
		return System.currentTimeMillis();
	}

	static void start() {
		t = millis();
	}
}