Harryxun/stf_run huggingface dataset:
import math
n,m = map(int, input().split())

def c(s,t):
    if s == 0 or s == 1:
        return 0
    return math.factorial(s)/(math.factorial(s-t)*math.fatorial(t))

print(c(n,2)+c(m,2))

### FIXED CODE ###

import math
n,m = map(int, input().split())

def c(s,t):
    if s == 0 or s == 1:
        return 0
    return math.factorial(s)/(math.factorial(s-t)*math.factorial(t))

print(int(c(n,2)+c(m,2)))
#abc15047d
n=int(raw_input())
a=map(int,raw_input().split())
mod=10**9+7
res=0
for i in range(60):
 cnt=sum([1 for x in a if (x>>i & 1)])
 res+=cnt*(n-cnt)*(1<<i)
 res=res%mod
print res


### FIXED CODE ###

#abc147a

a1,a2,a3=map(int,raw_input().split())
if a1+a2+a3>=22:
 print 'bust'
else:
 print 'win'
from collections import deque

if __name__ == '__main__':
    n = int(input())
    dll = deque()
    for _ in range(n):
        command = input().split()
        if command[0] == 'insert':
            dll.appendleft(command[1])
        elif command[0] == 'delete':
            dll.remove(command[1])
        elif command[0] == 'deleteFirst':
            dll.popleft()
        elif command[0] == 'deleteLast':
            dll.pop()
    print(*dll)



### FIXED CODE ###

# -*- coding:utf-8 -*-

from collections import deque

result = deque()

def operation(command):
    if command[0] == "insert":
        result.appendleft(command[1])
    elif command[0] == "delete":
        if command[1] in result:
            result.remove(command[1])
    elif command[0] == "deleteFirst":
        result.popleft()
    elif command[0] == "deleteLast":
        result.pop()

n = int(input())
for i in range(n):
    command = input().split()
    operation(command)
print(*result)
from collections import defaultdict

def get_prime_factors(x):
    out = []
    while not x%2:
        out.append(2)
        x //= 2
    i = 3
    while i*i <= x:
        if not x%i:
            out.append(i)
            x //= i
        else:
            i += 2
    if x != 1:
        out.append(x)
    return set(out)


def main():
    n = int(input())
    a = list(map(int, input().split()))
    df = defaultdict(lambda : 0)
    for ai in a:
        primes = get_prime_factors(ai)
        for prime in primes:
            df[prime] += 1
    val = max(df.values())
    if val == 1:
        print("pairwise coprime")
    elif val == n:
        print("not coprime")
    else:
        print("setwise coprime")

if __name__ == "__main__":
    main()

### FIXED CODE ###

from collections import defaultdict


def get_prime_factors(x):
    out = set()
    if x < 1:
        return out
    while not x%2:
        out.add(2)
        x //= 2
    i = 3
    while i*i <= x:
        if not x%i:
            out.add(i)
            x //= i
        else:
            i += 2
    if x != 1:
        out.add(x)
    return out


def main():
    n = int(input())
    a = list(map(int, input().split()))
    df = defaultdict(lambda : 0)
    for ai in a:
        primes = get_prime_factors(ai)
        for prime in primes:
            df[prime] += 1
    if df.values():
        val = max(df.values())
        if val == 1:
            print("pairwise coprime")
        elif val == n:
            print("not coprime")
        else:
            print("setwise coprime")
    else:
        print("pairwise coprime")

if __name__ == "__main__":
    main()
N = int(input())
A = list(map(int, input().split()))

B = list(range(1,N+1))
ab = []
for i in range(N):
    ab.append([A[i], B[i]])
print(ab)
ab.sort()
print(ab)
for i in range(N):
    print(ab[i][1], end = " ")

print()

### FIXED CODE ###

N=int(input())
cnt=0
for i in range(N):
    if (i+1)%2!=0:
        cnt+=1
print(cnt/N)
x,y = [int(x) for x in input().split()]

count = 1

while True:
    if x * 2 <= y:
        x = x * 2
        count += 1
    else:
	break

print(count)

### FIXED CODE ###

x,y = [int(x) for x in input().split()]

flag = True
count = 1

while flag:
    if x * 2 <= y:
        x = x * 2
        count += 1
        continue
    else:
        flag = False

print(count)
import sys

import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines


def main():
    N = int(readline())
    A = list(map(int, readline().split()))
    A = np.array(A)

    cnt = 0
    for _ in range(10**9):
        A, F = np.divmod(A, 2)
        if np.max(F) == 1:
            break
        cnt += 1

    print(cnt)


main()


### FIXED CODE ###

import sys

import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines


def main():
    N = int(readline())
    A = list(map(int, readline().split()))
    A = np.array(A)

    f = 0
    cnt = 0
    for _ in range(10**9):
        f = np.max(np.mod(A, 2))
        if f == 1:
            break
        A[:] = A[:]/2
        cnt += 1

    print(cnt)


main()
N=input()
print -(-N//2)


### FIXED CODE ###

N = int(input())
S = -(-N // 2)
print (S)
from bisect import bisect_left

N=int(input())
A=list(map(int,input().split()))
A=sorted(A)

idx = bisect_left(A,0)
if idx != 0:
  if idx % 2 == 1:
    if abs(A[idx-1]) > abs(A[idx]):
      A[idx-1] *= -1
      A[idx] *= -1
  for i in range(0,idx-1,2):
    A[i] *= -1
    A[i+1] *= -1

print(sum(A))

### FIXED CODE ###

from bisect import bisect_left

N=int(input())
A=list(map(int,input().split()))
A=sorted(A)

idx = bisect_left(A,0)
if idx != 0 and idx != N:
  if idx % 2 == 1:
    if abs(A[idx-1]) > abs(A[idx]):
      A[idx-1] *= -1
      A[idx] *= -1
  for i in range(0,idx-1,2):
    A[i] *= -1
    A[i+1] *= -1

if idx==N:
  if N % 2 == 0:
    print(-sum(A))
    exit()
  else:
    print(-sum(A[:-1])+A[-1])
    exit()

print(sum(A))
num, capacity = map(int, input().split())
dp = [0]*(capacity+1)

for i in range(1, num + 1):
    weight, value = map(int, input().split())
    for w in range(capacity,weight - 1,-1):
        if w < weight:
            continue
        else:
            dp[w] = max( dp[w - weight] + value,  dp[w] )
print(dp[num][capacity])

### FIXED CODE ###

def calc(num,capacity):
    dp = [0]*(capacity+1)
    for _ in range(num):
        weight, value = map(int, input().split())
        for w in range(capacity,weight - 1,-1):
            tmp = dp[w - weight] + value
            if dp[w] < tmp:
              dp[w] = tmp
    return dp[capacity]

num, capacity = map(int, input().split())
print(calc(num,capacity))
w = input()
X = [0 for i in range(26)]
for i in range(len(w)):
  X[ord(w[i]) - 97] ^= 1
if sum(X) == 0:
  print("Yes")
else:
  print("No)

### FIXED CODE ###

w = input()
X = [0 for i in range(26)]
for i in range(len(w)):
  X[ord(w[i]) - 97] ^= 1
if sum(X) == 0:
  print("Yes")
else:
  print("No")
from math import gcd

def lcm(n,m):
    return (n*m)//gcd(n,m)

def main():
    a,b,c,d=map(int,input().split())
    num=b-a+1
    moda1=(a-1)//c
    moda2=(a-1)//d
    moda3=(a-1)//(lcm(c,d))
    modat=moda1+moda2-moda3
    modb1=b//c
    modb2=b//d
    modb3=b//(lcm(c,d))
    modbt=modb1+modb2-modb3
    mod=modbt-modat
    return num-mod

print(main())

### FIXED CODE ###

from fractions import gcd

def lcm(n,m):
    return (n*m)//gcd(n,m)

def main():
    a,b,c,d=map(int,input().split())
    num=b-a+1
    moda1=(a-1)//c
    moda2=(a-1)//d
    moda3=(a-1)//(lcm(c,d))
    modat=moda1+moda2-moda3
    modb1=b//c
    modb2=b//d
    modb3=b//(lcm(c,d))
    modbt=modb1+modb2-modb3
    mod=modbt-modat
    return num-mod

print(main())
N=int(input())
a = sorted(map(int, input().split()))
print(abs((sum(a[1::2]) - sum(a[::2])))

### FIXED CODE ###


n = input()
a = sorted(map(int, input().split()))
print(abs(sum(a[1::2]) - sum(a[::2])))
''' ===========================================
from collections import deque
    appendleft() = push_front(), append = push_back()
    popfleft() = pop_front(), pop() = pop_back()
import heapq #heappush(trgt, val) heappop(trgt) trgt[0] __lt__<
=========================================== '''
##======================================python3
import sys
import collections
from sys import stdin #read(), readline()
input = stdin.readline
sys.setrecursionlimit(10**6)
INF = 1<<50
MINI = 100005

class gv:
    input:str = None;
    
def build():
    gv.str = input()

def solve():
    slen = len(gv.str)
    if (slen&1) == 1:
        print("No")
        return
    
    for i in range(0,slen,2):
        if (gv.str[i:i+2] == "hi") :
            pass
        else :
            print("No")
            return
    
    print("Yes")
    
    

if __name__ == '__main__':
    build()
    solve()


### FIXED CODE ###

class gv:
    input = None;
    
def build():
    gv.str = input()

def solve():
    slen = len(gv.str)
    if (slen&1) == 1:
        print("No")
        return
    
    for i in range(0,slen,2):
        if (gv.str[i:i+2] == "hi") :
            pass
        else :
            print("No")
            return
    
    print("Yes")
    
    

build()
solve()
def back_oturigation(fee, coin_values, coin_nums):
    """
    1. ????????????????????????????????£??????????????????
    2. 1????????????????????????????????????????????????????????????
       ???????????§?????????????????????-> ?°????????????????????¶???????????????????
    3. 2????????????????????°?????????????????????????????????????????????
    """
    # 1.
    oturi = coin_values[0]*coin_nums[0]\
            +coin_values[1]*coin_nums[1]\
            +coin_values[2]*coin_nums[2]\
            +coin_values[3]*coin_nums[3]\
            -fee
    use_coins = [0] * len(coin_values)
    no_use_coins = [0]*len(coin_values)

    # 2.
    for i in range(len(coin_values)-1, -1, -1):
        no_use_coins[i] = int(oturi / coin_values[i])
        oturi = oturi - (coin_values[i] * no_use_coins[i])


    #3.
    result = ""
    for i in range(0, len(use_coins), 1):
        use_coins[i] = coin_nums[i] - no_use_coins[i]
        if use_coins[i] > 0:
            print(str(coin_values[i]) + ' ' + str(use_coins[i]))
            result = result+str(coin_values[i]) + ' ' + str(use_coins[i])+'\n'
    return result

if __name__ == "__main__":

    #check_testcase()
    total_fee = int(input('total_fee:'))

    while(True):
        if total_fee == 0:break
        coins = input('total_coins:')
        coins = coins.split(' ') #10, 50, 100, 500????????§????????????
        coins = [int(coin) for coin in coins]
        coin_values=[10, 50, 100, 500]
        back_oturigation(total_fee, coin_values, coins)

### FIXED CODE ###

import math
def back_oturigation(fee, coin_values, coin_nums):
    """
    1. ?????????????????????????????????£??????????????????
    2. 1????????????????????????????????????????????????????????????
       ????????????§?????????????????????-> ??°?????????????????????¶???????????????????
    3. 2?????????????????????°?????????????????????????????????????????????
    """
    # 1.
    oturi = coin_values[0] * coin_nums[0] \
            + coin_values[1] * coin_nums[1] \
            + coin_values[2] * coin_nums[2] \
            + coin_values[3] * coin_nums[3] \
            - fee

    use_coins = [0] * len(coin_values)
    no_use_coins = [0] * len(coin_values)
 
    # 2.
    for i in range(len(coin_values) - 1, -1, -1):
        no_use_coins[i] = int(oturi / coin_values[i])
        oturi = oturi - (coin_values[i] * no_use_coins[i])
 
    # 3.
    for i in range(0, len(use_coins), 1):
        use_coins[i] = coin_nums[i] - no_use_coins[i]
        if use_coins[i] > 0:
            print(str(coin_values[i]) + ' ' + str(use_coins[i]))
 
if __name__ == "__main__":
    first = True
    while (True):
        total_fee = int(input(''))
        if total_fee == 0:
            break
        if first:
            first = False
        else:
            print('')
        coins = input('')
        coins = coins.split(' ')  # 10, 50, 100, 500?????????§????????????
        coins = [int(coin) for coin in coins]
        coin_values = [10, 50, 100, 500]
        back_oturigation(total_fee, coin_values, coins)
import math
t=0
X=int(input())
while True:
  t=0
  for i in range(2,math.ceil((X)**(1/2))+1):
    if X%i==0:
      break
    else:
      t+=1
  if t=math.ceil((X)**(1/2))-1:
    break
  X+=1
print(X)


### FIXED CODE ###

import math
t=0
X=int(input())
while True:
  if X==2:
    break
  t=0
  for i in range(2,math.ceil((X)**(1/2))+1):
    if X%i==0:
      break
    else:
      t+=1
  if t==math.ceil((X)**(1/2))-1:
    break
  X+=1
print(X)
N = int(input())
remain  = []
S1 = 0
S2 = 0
string = list(map(int,input().split())
for T in range(1,N+1):
    for i in range(T):
        S1 += string[i]
    for j in range(T, len(string)):
        S2 += string[j]
    remain.append(abs(S1-S2))
    S1 = 0
    S2 = 0
print(min(remain))
              
          
        
              
      
        
        


### FIXED CODE ###

N = int(input())
string = list(map(int,input().split()))
remain  = []
S1 = 0
S2 = 0

for T in range(1,N+1):
    for i in range(T):
        S1 += string[i]
    for j in range(T, len(string)):
        S2 += string[j]
    remain.append(abs(S1-S2))
    S1 = 0
    S2 = 0
print(min(remain))
a, b, c =(int(x) for x in input().split())
count = 0
if a == 1:
  count++
if b == 1:
  count++
if c == 1:
  count++

print(str(count))

### FIXED CODE ###

a =input()
count = print(str(a.count('1')))
# -*- coding: utf-8 -*-
import fractions

N = int(input().rstrip())
As = list(map(int, input().rstrip().split()))


def gcd_list(numbers):
    res = math.gcd(numbers[0], numbers[1])
    if len(numbers) > 2:
        for idx in range(2, len(numbers)):
            res = fractions.gcd(res, numbers[idx])
    return res


max_gcd = 0
if(N) == 2:
    max_gcd = max(As)
else:
    for i in range(N):
        others = [As[j] for j in range(N) if j != i]
        max_gcd = max(gcd_list(others), max_gcd)

print(max_gcd)

### FIXED CODE ###

# -*- coding: utf-8 -*-
import numpy as np
A, B, T = map(int, input().split())

x = int(np.floor((T + 0.5) / A))

print(x * B)
from itertools import product


for bfo2, bfo1 in product(['S', 'W'], repeat=2):
    ans = [bfo2, bfo1]
    for i in s:
        if ((bfo1 == 'S' and i == 'o')
                or (bfo1 == 'W' and i == 'x')):
            ans.append(bfo2)
        elif ((bfo1 == 'S' and i == 'x')
                or (bfo1 == 'W' and i == 'o')):
            ans.append(*({'S', 'W'} - {bfo2}))
        bfo1, bfo2 = ans[-1], bfo1
    if ans[:2] == ans[-2:]:
        print(*ans[1:-1], sep='')
        break
else:
    print(-1)


### FIXED CODE ###

def solve(bfo2, bfo1):
    ans = [bfo2, bfo1]
    for i in s:
        if ((bfo1 == 'S' and i == 'o')
                or (bfo1 == 'W' and i == 'x')):
            ans.append(bfo2)
        else:
            ans.append('S' if bfo2 == 'W' else 'W')
        bfo1, bfo2 = ans[-1], bfo1
    if ans[:2] == ans[-2:]:
        print(*ans[1:-1], sep='')
        exit()


n, s = int(input()), input()

for i in ['S', 'W']:
    for j in ['S', 'W']:
        solve(i, j)
print(-1)
import bisect
from collections import defaultdict
N = int(input())
S = input()
Q = int(input())

dict = defaultdict(list)
for i in range(N):
    dict[S[i]].append(i)
# print(dict)

ans = []

for _ in range(Q):
    a, b, c = input().split()
    a = int(a)

    if a == 1:
        b = int(b) - 1
        if S[b] == c:
            continue
        else:
            dict[S[b]].remove(b)
            idx = bisect_left(dict[c], b)
            dict[c].insert(idx, b)
            S[i] = c

    elif a == 2:
        b = int(b) - 1
        c = int(c) - 1
        char_n = 0
        for key, value in dict.items():
            x1 = bisect.bisect_left(value, b)
            x2 = bisect.bisect_right(value, c)
            if x2 - x1 > 0:
                char_n += 1
        ans.append(char_n)

for i in ans:
    print(i)


### FIXED CODE ###

# test!!!!!!!!!!!

from bisect import bisect_left, bisect_right

N = int(input())

S = list(input())

Q = int(input())

memo = {chr(ord('a') + i): [] for i in range(26)}

for key,val in enumerate(S):
    memo[val].append(key)

for q in range(Q):
    query = list(input().split())
    if query[0] == '1':
        i, x = int(query[1])-1, query[2]
        now = S[i]
        if now == x:
            continue
        memo[now].remove(i)
        next_i = bisect_left(memo[x], i)
        memo[x].insert(next_i, i)
        S[i] = x
    else:
        start, end = int(query[1])-1, int(query[2])-1
        tmp_cout = 0
        for alf_array in memo.values():
            if len(alf_array) == 0:
                continue
            ss = bisect_left(alf_array, start)
            gg = bisect_right(alf_array, end)
            if gg- ss > 0:
                tmp_cout += 1
        print(tmp_cout)
if __name__ == "__main__":
    mod = 998244353

    n = int(input())
    d = list(map(int, input().split()))

    if d[0] > 0:
        print('0')
        exit()

    if len(d) == 1:
        print('1')
        exit()

    d.sort()
    d.pop(0)
    if d[0] == 0:
        print('0')
        exit()

    tmp = 1
    ans = 1
    max_num = max(d)
    dic = dict()
    for i in range(n-1):
        if d[i] in dic:
            dic[d[i]] += 1
        else:
            dic[d[i]] = 1

    for i in range(1, max_num+1):
        count = dic[i]
        if count == 0:
            print('0')
            exit()
        ans *= tmp ** count
        ans %= mod
        tmp = count

    print(ans)


### FIXED CODE ###

if __name__ == "__main__":
    mod = 998244353

    n = int(input())
    d = list(map(int, input().split()))

    if d[0] > 0:
        print('0')
        exit()

    if len(d) == 1:
        print('1')
        exit()

    d.sort()
    d.pop(0)
    if d[0] == 0:
        print('0')
        exit()

    tmp = 1
    ans = 1
    max_num = max(d)
    dic = dict()
    for i in range(n-1):
        if d[i] in dic:
            dic[d[i]] += 1
        else:
            dic[d[i]] = 1

    for i in range(1, max_num+1):
        if i in dic:
            count = dic[i]
        else:
            print('0')
            exit()
        if count == 0:
            print('0')
            exit()
        ans *= tmp ** count
        ans %= mod
        tmp = count

    print(ans)
x = round(n /2)
return x

### FIXED CODE ###

n = int(input())
if n%2==0:
    print(str((n/2)/n))
else:
    print(str(((n+1)/2)/n))
import sys
sys.setrecursionlimit(10000)

N, M = (int(i) for i in input().split())
P = [None for i in range(N+1)]
Tree = [list() for i in range(N+1)]
for index in range(M):
	L, R, D = (int(i) for i in input().split())
	Tree[L].append((R, D))
	Tree[R].append((L,-D))

def process(i):
	global P, Tree
	obj = Tree[i]
	if P[i] is None:
		P[i] = 0
	if len(obj) != 0:
		for j, d in obj:
			if P[j] is None:
				P[j] = P[i] + d
				process(j)
			else:
				if P[j] - P[i] != d:
					print("No")
					exit(0)

for i in range(1,N+1):
	process(i)

print("Yes")

### FIXED CODE ###

import sys

N, M = (int(i) for i in input().split())
P = [None for i in range(N+1)]
Graph = [list() for i in range(N+1)]
for index in range(M):
	L, R, D = (int(i) for i in input().split())
	Graph[L].append((R, D))
	Graph[R].append((L,-D))

def determine(i):
	if P[i] is not None:
		return
	P[i] = 0
	stack = [i]
	while len(stack) != 0:
		I = stack.pop()
		for j, d in Graph[I]:
			if P[j] is None:
				P[j] = P[I] + d
				stack.append(j)

def check(i):
	for j, d in Graph[i]:
		if P[j] - P[i] != d:
			print("No")
			exit(0)

for i in range(1,N+1):
	determine(i)

for i in range(1,N+1):
	check(i)

print("Yes")
list = [for int(i) in input.split()]

count = 0
for i in range(0, len(list)-1):
  if list[i] < list[i+1]:
    count += 1
  	
if count > 2:
  print('NO')
else:
  print('YES')

### FIXED CODE ###

N = int(input())
num_list = [int(_) for _ in input().split()]
 
count = 0
 
for i in range(0, N):
  if num_list[i] != i+1:
    count += 1
    
if count <= 2:
  print('YES')
else:
  print('NO')
import sys
sys.setrecursionlimit(10000000)


def gcd(aa, b):
    if b == 0:
        return aa
    return gcd(b, aa % b)


mod = 1e9 + 7
n = int(input())
a = [int(i) for i in input().split()]
kek = 1
for i in range(n):
    kek = (kek * a[i]) // gcd(kek, a[i])
s = 0
for i in range(n):
    s += kek // a[i]
print(int(s % mod))




### FIXED CODE ###

import sys
sys.setrecursionlimit(10000000)


def gcd(aa, b):
    if b == 0:
        return aa
    return gcd(b, aa % b)


mod = int(1e9 + 7)
n = int(input())
a = [int(i) for i in input().split()]
kek = 1
for i in range(n):
    kek = (kek * a[i]) // gcd(kek, a[i])
s = 0
for i in range(n):
    s += kek // a[i]
print(int(s % mod))
N = int(input())
if N == 1:
     print("Hello World")
else:
     A =  int(input())
     B =  int(input())
     print(A+B
     




### FIXED CODE ###

N=int(input())
sum_a=0
if N==1:
    print("Hello World")
else:
    for _ in range(2):
        a=int(input())
        sum_a+=a
    print(sum_a)
import numpy as np
X, N = (int(i) for i in input().split())
p = sorted([int(i) for i in input().split()])
if X in p:
    s = p.index(X)
    i = 0
    while ((s-i)>=0) or ((s+i)<N):
        if p[s-i] != (X-i):
            print(X-i)
            break
        if p[s+i] != (X+i):
            print(X+i)
            break
        i = i + 1
    else:
        print(p[0]-1)
else:
    print(X)

### FIXED CODE ###

import numpy as np
X, N = (int(i) for i in input().split())
p = sorted([int(i) for i in input().split()])
if X in p:
    s = p.index(X)
    i = 1
    while True:
        if (s-i)<0:
            print(p[0]-1)
            break
        elif p[s-i] != (X-i):
            print(X-i)
            break
        elif (s+i)>=N:
            print(p[N-1]+1)
            break
        elif p[s+i] != (X+i):
            print(X+i)
            break
        else:
            i = i + 1
else:
    print(X)
n=int(input())
alice=[]
bob=[]
l=list(map(int,input().split()))
while len(l)>0:
    alice.append(max(l))
    l.remove(max(l))
    bob.append(max(l))
    l.remove(max(l))

print(sum(alice)-sum(bob))


### FIXED CODE ###

n=int(input())
alice=[]
bob=[]
l=list(map(int,input().split()))
while len(l)>0:
    alice.append(max(l))
    l.remove(max(l))
    if len(l)>0:
        bob.append(max(l))
        l.remove(max(l))

print(sum(alice)-sum(bob))
N=int(input())
S=list(map(int, input().split()))
X=set()
for s in S:
  X.add(s)
  
if len(X)==3:
  print('Three')
else:
  print('Four')

### FIXED CODE ###

N=int(input())
S=list(input().split())
X=set()
for s in S:
  X.add(s)
  
if len(X)==3:
  print('Three')
else:
  print('Four')
def dfs(v,n,visited):#深さ優先探索
    all_visited=1#全ての点を通ったか調べる
      
    for i in range(n):
        if visited[i]==0:
            all_visited=0
    if all_visited==1:
        return 1
    count=0
    for i in range(n):
        if path[v][i]!=0:
            continue 
        if visited[i]==1:
            continue
        visited[i]=1
        count+=dfs(i,n,visited)
        visited[i]=0
    return count

n,m=map(int,input().split())
path=[[0]*n for i in range(n)]
for i in range(n):
    a,b=map(int,input().split())
    path[a-1][b-1]=1
    path[b-1][a-1]=1#隣接していれば１
visited=[0]*n
visited[0]=1#1は初めに通る
print(dfs(0,n,visited))



### FIXED CODE ###

n,m=map(int,input().split())
path=[[0]*n for i in range(n)]
for i in range(m):
    a,b=map(int,input().split())
    path[a-1][b-1]=1
    path[b-1][a-1]=1#隣接グラフを作成
visited=[0]*n#どこを通ったか記憶
visited[0]=1#１は最初に通る
def dfs(position,visited,n):#深さ優先探索
    all_visited=1
    for i in range(n):
        if visited[i]==0:
            all_visited=0#行ったことがない点があれば０
            break#どこかで見つかったらループ終了
    if all_visited==1:
        return 1#全部回れたら１回カウント
    count=0#経路の個数をカウント
    for next in range(n):#次に移動する点
        if path[position][next]==0:
            continue#道がなければ次へ
        if visited[next]==1:
            continue#行ったことがあれば次へ
        visited[next]=1
        count+=dfs(next,visited,n)
        visited[i]=0#行った記録を消去して前のループに戻る
    visited[position]=0

    return count
print(dfs(0,visited,n))
n, r = map(lambda x: int(x), input().split())
if n < 10:
  print(100*(10-n)+r)
  return
print(r)

### FIXED CODE ###

n, r = map(lambda x: int(x), input().split())
if n < 10:
  print(100*(10-n)+r)
else:
  print(r)
a,b,c,x=map(int, input().split())
i=0
for p in range(a+1):
    for q in range(b+1):
        for r in range(c+1):
            if 500*p+100*q+50*r==x:
                i+=1
print(i)

### FIXED CODE ###

a,b,c,x=[int(input()) for i in range(4)]
i=0
for _ in range(a+1):
    for j in range(b+1):
        for k in range(c+1):
            if 500*_+100*j+50*k==x:
                i+=1
print(i)