#include using namespace std; int n,mm; pair tmp; map< int, set > m; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); cin>>n>>mm; for(int i=0; i>tmp.first>>tmp.second; m[tmp.second].insert(tmp.first); } int ans = 0; for(auto x : m) { ans+=x.second.size()-1; } cout<