#include<cstdio>
#include<iostream>
#include<algorithm>
#include<cmath>
#include<cstdlib>
#include<queue>
#include<map>
#include<set>
#include<string>
#include<vector>
#include<cstring>
#include<stack>
#include<climits>
using namespace std;
int enemy[101][3];
int A[101];
int num[101];
int flag[101];
int visited[101];
bool dfs(int node,int start,int count){
int i;
if(node == start && visited[node] == 1)
return true;
visited[node]++;
for(i=1;i<=num[node];i++){
if(!visited[enemy[node][i]] || (enemy[node][i] == start && count >= 2))
return dfs(enemy[node][i],start,count+1);
}
return false;
}
int cycle(int node,int start,int count){
int i;
flag[node] = 1;
if(node == start && visited[node] == 1)
return count;
visited[node]++;
for(i=1;i<=num[node];i++){
if(!visited[enemy[node][i]] || (enemy[node][i] == start && count >= 2))
return cycle(enemy[node][i],start,count+1);
}
}
int main(){
int m,n,i,j,a,b,k,temp,t1,t2,count;
scanf("%d%d",&n,&m);
for(i=1;i<=m;i++){
scanf("%d%d",&a,&b);
num[a]++;
num[b]++;
enemy[a][num[a]] = b;
enemy[b][num[b]] = a;
}
t1 = 0;
t2 = 0;
temp = n;
for(i=1;i<=n;i++){
if(!flag[i] && num[i] == 2){
if(dfs(i,i,0)){
for(j=1;j<=n;j++) visited[j] = 0;
count = cycle(i,i,0);
n-=count;
t1+=count/2;
t2+=count/2;
}
}
}
t1+=n/2;
t2+=n/2;
printf("%d\n",temp-t1-t2);
return 0;
}
I2luY2x1ZGU8Y3N0ZGlvPgojaW5jbHVkZTxpb3N0cmVhbT4KI2luY2x1ZGU8YWxnb3JpdGhtPgojaW5jbHVkZTxjbWF0aD4KI2luY2x1ZGU8Y3N0ZGxpYj4KI2luY2x1ZGU8cXVldWU+CiNpbmNsdWRlPG1hcD4KI2luY2x1ZGU8c2V0PgojaW5jbHVkZTxzdHJpbmc+CiNpbmNsdWRlPHZlY3Rvcj4KI2luY2x1ZGU8Y3N0cmluZz4KI2luY2x1ZGU8c3RhY2s+CiNpbmNsdWRlPGNsaW1pdHM+Cgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IGVuZW15WzEwMV1bM107CmludCBBWzEwMV07CmludCBudW1bMTAxXTsKaW50IGZsYWdbMTAxXTsKaW50IHZpc2l0ZWRbMTAxXTsKCmJvb2wgZGZzKGludCBub2RlLGludCBzdGFydCxpbnQgY291bnQpewogICAgaW50IGk7CiAgICBpZihub2RlID09IHN0YXJ0ICYmIHZpc2l0ZWRbbm9kZV0gPT0gMSkKICAgICAgICByZXR1cm4gdHJ1ZTsKICAgIHZpc2l0ZWRbbm9kZV0rKzsKICAgIGZvcihpPTE7aTw9bnVtW25vZGVdO2krKyl7CiAgICAgICAgaWYoIXZpc2l0ZWRbZW5lbXlbbm9kZV1baV1dIHx8IChlbmVteVtub2RlXVtpXSA9PSBzdGFydCAmJiBjb3VudCA+PSAyKSkKICAgICAgICAgICAgcmV0dXJuIGRmcyhlbmVteVtub2RlXVtpXSxzdGFydCxjb3VudCsxKTsKICAgIH0KICAgIHJldHVybiBmYWxzZTsKfQoKaW50IGN5Y2xlKGludCBub2RlLGludCBzdGFydCxpbnQgY291bnQpewogICAgaW50IGk7CiAgICBmbGFnW25vZGVdID0gMTsKICAgIGlmKG5vZGUgPT0gc3RhcnQgJiYgdmlzaXRlZFtub2RlXSA9PSAxKQogICAgICAgIHJldHVybiBjb3VudDsKICAgIHZpc2l0ZWRbbm9kZV0rKzsKICAgIGZvcihpPTE7aTw9bnVtW25vZGVdO2krKyl7CiAgICAgICAgaWYoIXZpc2l0ZWRbZW5lbXlbbm9kZV1baV1dIHx8IChlbmVteVtub2RlXVtpXSA9PSBzdGFydCAmJiBjb3VudCA+PSAyKSkKICAgICAgICAgICAgcmV0dXJuIGN5Y2xlKGVuZW15W25vZGVdW2ldLHN0YXJ0LGNvdW50KzEpOwogICAgfQp9CgppbnQgbWFpbigpewogICAgaW50IG0sbixpLGosYSxiLGssdGVtcCx0MSx0Mixjb3VudDsKICAgIHNjYW5mKCIlZCVkIiwmbiwmbSk7CiAgICBmb3IoaT0xO2k8PW07aSsrKXsKICAgICAgICBzY2FuZigiJWQlZCIsJmEsJmIpOwogICAgICAgIG51bVthXSsrOwogICAgICAgIG51bVtiXSsrOwogICAgICAgIGVuZW15W2FdW251bVthXV0gPSBiOwogICAgICAgIGVuZW15W2JdW251bVtiXV0gPSBhOwogICAgfQogICAgdDEgPSAwOwogICAgdDIgPSAwOwogICAgdGVtcCA9IG47CiAgICBmb3IoaT0xO2k8PW47aSsrKXsKICAgICAgICBpZighZmxhZ1tpXSAmJiBudW1baV0gPT0gMil7CiAgICAgICAgICAgIGlmKGRmcyhpLGksMCkpewogICAgICAgICAgICAgICAgZm9yKGo9MTtqPD1uO2orKykgdmlzaXRlZFtqXSA9IDA7CiAgICAgICAgICAgICAgICBjb3VudCA9IGN5Y2xlKGksaSwwKTsKICAgICAgICAgICAgICAgIG4tPWNvdW50OwogICAgICAgICAgICAgICAgdDErPWNvdW50LzI7CiAgICAgICAgICAgICAgICB0Mis9Y291bnQvMjsKICAgICAgICAgICAgfQogICAgICAgIH0KICAgIH0KICAgIHQxKz1uLzI7CiAgICB0Mis9bi8yOwogICAgcHJpbnRmKCIlZFxuIix0ZW1wLXQxLXQyKTsKICAgIHJldHVybiAwOwp9Cg==