import itertools
N, K = map(int, input().split())

LR = [map(int, input().split()) for _ in range(K)]
L, R = [list(i) for i in zip(*LR)]

L.extend(R)
LR = list(set(L))

count = 0
for j in range(N):
  h = list(itertools.combinations_with_replacement(LR, j))
  print(h)

  for i in range(len(h)):
    if sum(h[i]) == N - 1:
      count += 1
      if len(h[i]) > 1:
        if h[i][0] != h[i][i]:
          count += 1

    
      
print(count)