#include <iostream>
#include <vector>
#include <iterator>
#include <map>
#include <unordered_map>

const int N_MAX = 50 + 1;

struct pair_hash {
	template <class T1, class T2>
	std::size_t operator() (const std::pair<T1, T2> &pair) const
	{
		return std::hash<T1>()(pair.first) ^ std::hash<T2>()(pair.second);
	}
};

//std::unordered_map<std::pair<int,int>, bool, pair_hash> loop = {};
bool loop[N_MAX][N_MAX] = {};
std::unordered_map<int, std::vector<int>> m = {};

void print(std::vector<int> v)
{
  for (auto iter=v.begin(); iter!=v.end(); iter++) std::cout << *iter << ' ';
  std::cout << std::endl;
}

void print(std::map<int, std::vector<int>> m)
{
  for (auto iter=m.begin(); iter!=m.end(); iter++) {
    std::cout << iter->first << ": ";
    print(iter->second);
  }
}

void print(std::unordered_map<int, std::vector<int>> m)
{
  for (auto iter=m.begin(); iter!=m.end(); iter++) {
    std::cout << iter->first << ": ";
    print(iter->second);
  }
}

int dfs(std::vector<int> path)
{
  int ret = 0;
  //std::cout << "new dfs ::: "; print(path);
  int node = path.back();
  path.pop_back();
  for (auto iter=path.begin(); iter!=path.end(); iter++) {
    if (*iter==node) {
      //std::cout << "_____loop found at " << node << "!\n";
      path.push_back(node);
      while (1) {
        int u = path.back(); path.pop_back();
        int v = path.back(); path.pop_back();
        if (!loop[u][v]) {
          //std::cout << "new subloop found: " << u << "--" << v << std::endl;
          loop[u][v] = true;
          loop[v][u] = true;
          ret++;
        }
        /*
        std::pair<int,int> e = std::make_pair(u, v);
        std::pair<int,int> d = std::make_pair(u, v);
        if (loop.find(e) == loop.end()) {
          std::cout << "new subloop found: " << u << "--" << v << std::endl;
          loop[e] = true;
          loop[d] = true;
          std::cout << "search result: " << (loop.find(e) == loop.end()) << ' ' << (loop.find(e) == loop.end()) << std::endl;
          ret++;
        }
        */
        if (v==node) break;
        path.push_back(v);
      }
      return ret;
      /*
      int prev = path.back();
      path.pop_back();
      std::pair<int,int> p = std::make_pair(prev, node);
      std::pair<int,int> p2 = std::make_pair(node, prev);
      if (loop.find(p) == loop.end()) {
        loop.insert({p, true});
        loop.insert({p2, true});
        return 1;
      }
      else return 0;
      */
    }
  }
  int prev = -1;
  if (!path.empty()) prev = path.back();
  path.push_back(node);
  for (auto iter=m[node].begin(); iter!=m[node].end(); iter++) {
    if (prev==-1 || *iter!=prev) {
      path.push_back(*iter);
      ret += dfs(path);
      path.pop_back();
    }
  }
  return ret;
}

int main()
{
  int N, M;
  std::cin >> N >> M;
  for (int i=0; i<M; i++) {
    int from, to;
    std::cin >> from >> to;
    m[from].push_back(to);
    m[to].push_back(from);
  }
  //print(m);

  std::vector<int> visited = {};
  visited.push_back(m.begin()->first);
  //std::cout << "visited: ";
  //print(visited);
  int ans = dfs(visited);
/*
  int a = 3, b = 3;
  int c = a + b;
  auto p1 = std::make_pair(a, c);
  auto p2 = std::make_pair(b, c);

  std::cout << "same?: " << (p1==p2);
*/
  std::cout << M - ans;

  return 0;
}


Measured memory_bytes: 256