import sys input = sys.stdin.readline from collections import deque def bfs(G, s): Q = deque([s]) N = len(G) dist = [-1] * N par = [-1] * N dist[s] = 0 while Q: u = Q.popleft() for v in G[u]: if dist[v] != -1: continue dist[v] = dist[u] + 1 par[v] = u Q.append(v) return dist N, M = map(int, input().split()) G = [[] for i in range(N)] for _ in range(M): u, v = map(int, input().split()) u, v = u - 1, v - 1 G[u].append(v) G[v].append(u) ans = [1, 0] dist = bfs(G, 0) from collections import * C = Counter(dist) for i in range(1, N + 1): ans[i % 2] += C[i] print(ans[i % 2])