        #include <bits/stdc++.h>
        using namespace std;
   #define int long long
   #define PP pair<int,pair<int,int>>
const int MAX = 1000001;
const int MOD =1000000007;
const int INV2 = (MOD+1)/2;



     signed main(){
 int n,m;
 cin>>n>>m;
 bitset<400> b[n];
 for(int i=0;i<n;i++)b[i].set(i);
 int x,y;
 for(int i=0;i<m;i++){
   cin>>x>>y;x--;y--;
   if((b[x]&b[y]).none())b[x]|=b[y];
   else b[x]|=(~b[x]);
     
 

    b[y]=b[x];
  
 }
 int ans=0;
 for(int i=0;i<n;i++)for(int j=0;j<i;j++)if((b[i]&b[j]).none())ans++;
 cout<<ans<<endl;



}


        
