1 #include<iostream>
2 #include<cstdlib>
3 #include<cstdio>
4 #include<cstring>
5 #include<algorithm>
6 #include<map>
7 #include<queue>
8 #include<string>
9 #include<cmath>
10 using namespace std;
11 int n,p,zz;
12 struct ro{
13 int to;
14 int next;
15 int from;
16 int bh,size;
17 }road[900];
18 int a[350];
19 void build(int x,int y){
20 zz++;
21 road[zz].bh=zz;
22 road[zz].to=y;
23 road[zz].from=x;
24 road[zz].next=a[x];
25 a[x]=zz;
26 }
27 int fa[350],son[350],ans=0x7fffffff;
28 void dfs1(int x){
29 for(int i=a[x];i>0;i=road[i].next)
30 {
31 int y=road[i].to;
32 if(y!=fa[x])
33 {
34 son[x]++;
35 fa[y]=x;
36 dfs1(y);
37 road[i].size=son[y];
38 }
39 }
40 }
41 int q[9000],head,en;
42 void bfs(int js){
43 if(js>=ans) return;
44 int qq[9000],hea=head,ed=en;
45 memcpy(qq,q,sizeof(q));
46 int jj=js;
47 for(int i=hea;i<=ed;i++)
48 {
49 js=jj;
50 head=1,en=0;
51 memset(q,0,sizeof(q));
52 for(int j=hea;j<=ed;j++)
53 {
54 if(i==j) continue;
55 js++;
56 for(int k=a[qq[j]];k>0;k=road[k].next)
57 {
58 int y=road[k].to;
59 if(y!=fa[qq[j]])
60 {
61 en++;
62 q[en]=y;
63 }
64 }
65 }
66 if(js>ans)
67 return;
68 if(en==0)
69 {
70 ans=min(ans,js);
71 return;
72 }
73 if(js!=jj) bfs(js);
74 }
75
76 }
77 int main(){
78 freopen("epidemic.in","r",stdin);
79 freopen("epidemic.out","w",stdout);
80 scanf("%d%d",&n,&p);
81 for(int i=1;i<=p;i++)
82 {
83 int x,y;
84 scanf("%d%d",&x,&y);
85 build(x,y);
86 build(y,x);
87 }
88 dfs1(1);
89 head=1;
90 cout<<endl;
91 for(int i=a[1];i>0;i=road[i].next)
92 {
93 int y=road[i].to;
94 en++;
95 q[en]=y;
96 }
97 bfs(1);
98 printf("%d\n",ans);
99 //while(1);
100 return 0;
101 }