Harryxun/stf_run huggingface dataset:
A B = map(int(input()))

num = B / A
if B == 1:
  print("0")
else if B % A == 0:
  print(int(num))
else:
  print(int(num + 1))

### FIXED CODE ###

A, B = map(int,input().split())
num = B / A
i = 0
if B == 1:
  print(int(0))
else:
  while True:
    if B == 1:
        print(0)
        break
    if A * i - (i - 1) >= B:
        print(i)
        break
    i += 1
a,b=map(int,input().split())
if (a+b)%2==1:
  return 'Odd'
else:
  return 'Even'


### FIXED CODE ###

a,b=map(int,input().split())
if (a*b)%2==1:
  print('Odd')
else:
  print('Even')
a,b,c,d=map(int,input().split())
if max(a)>max(b):
    print('Yes')
elif max(a)==max(b):
    if a+b>=c+d:
        print('Yes')
    else:
        print('No')
else:
    if min(a,b)>=min(c,d):
        print('Yes')
    else:
        print('No')
        
    

### FIXED CODE ###

a,b,c,d=map(int,input().split())
ans=0
while a>0 and c>0:
    c-=b
    ans+=1
    if c<=0:
        break
    a-=d
    ans+=1
    if a<=0:
        break
if ans%2==0:
    print('No')
else:
    print('Yes')
n,m = map(int,input().split())
if n == m;
    print(Yes)
else:
    print(No)

### FIXED CODE ###

n,m = map(int,input().split())
if n == m:
    print("Yes")
else:
    print("No")
n = int(input())
l = [0] * 100010
for i in range(n):
    a = int(input())
    if l[a] == 0:
        l[a] = 1
    else:
        l[a] = 0
print(sum(l))

### FIXED CODE ###

n = int(input())
l = [0] * 100010

mp = {}
for i in range(n):
    a = int(input())
    if a in mp:
        del mp[a]
    else:
        mp[a] = 1
print(len(mp))
a = int(input())
b = math.floor(a**0.5) + 1

x = []
for i in range(1,b):
    for j in range(1,b):
        for k in range(1,b):
            l = i**2 + j**2 + k**2 + i*j + j*k + k*i
            x.append(l)

t = [0] * a
for i in range(0,len(x)):
    if x[i] <= a:
        t[x[i]] = t[x[i]] + 1

for i in t:
    print(i)

### FIXED CODE ###

a = int(input())
b = round(a**0.5) + 1

x = []
for i in range(1,b):
    for j in range(1,b):
        for k in range(1,b):
            l = i**2 + j**2 + k**2 + i*j + j*k + k*i
            x.append(l)

t = [0] * a
for i in range(0,len(x)):
    if x[i] <= a:
        t[x[i]-1] = t[x[i]-1] + 1

for i in t:
    print(i)
import math
from sys import stdin,stdout
#% 998244353
from heapq import heapify,heappop,heappush

import collections
# T = int(stdin.readline())
# for i in range(T):
    #N=int(stdin.readline())
N,M=list(map(int,stdin.readline().split()))
hill=list(map(int,stdin.readline().split()))

dc=collections.defaultdict(list)
#vis=set()
for m in range(M):
    A,B=list(map(int,stdin.readline().split()))
    dc[A].append(B)
    dc[B].append(A)

ans=0
for k,ls in dc.items():

    f=0
    z=0
    for h in ls:

        if hill[k-1]<=hill[h-1]:
            f=1
            break

    if not f:
      #  print(k)
        ans+=1  
#print(ans)
#ans+=(N-len(dc.keys()))
print(ans)            

### FIXED CODE ###

import math
from sys import stdin,stdout
#% 998244353
T = stdin.readline()
T=T[:-1]
if T=="ABC":
    print("ARC")
elif T=="ARC":
    print("ABC")
a = input()
b = int(a[0])
c = int(a[2])
if b = c:
print("Yes")
else:
print("No")


### FIXED CODE ###

N = input()
A = int(N[0])
B = int(N[1])
C = int(N[2])
if A==C:
 print("Yes")
else:
 print("No")
from scipy.sparse import coo_matrix
from scipy.sparse.csgraph import bellman_ford
N, M = [int(i) for i in input().split()]
rows = []
cols = []
weights = []

for _ in range(M):
    # u v 間のコスト
    u, v = [int(i) for i in input().split()]
    rows.append(u-1)
    cols.append(v-1)
    weights.append(-1)

graph = coo_matrix((weights, (rows, cols)), shape=(N, N)).tocsr()
for i in range(N):
    try:
        d1 = bellman_ford(graph, indices = [i], directed=True, unweighted=False)
    except:
        print(0)
        exit()
else:
    print(-1)


### FIXED CODE ###

from collections import defaultdict
from heapq import heappop, heappush


class Graph(object):
    """
    隣接リストによる有向グラフ
    """

    def __init__(self):
        self.graph = defaultdict(list)

    def __len__(self):
        return len(self.graph)

    def add_edge(self, src, dst, weight=1):
        self.graph[src].append((dst, weight))

    def get_nodes(self):
        return self.graph.keys()


class Dijkstra(object):
    """
    ダイクストラ法（二分ヒープ）による最短経路探索
    計算量: O((E+V)logV)
    """

    def __init__(self, graph, start):
        self.g = graph.graph

        # startノードからの最短距離
        # startノードは0, それ以外は無限大で初期化
        self.dist = defaultdict(lambda: float('inf'))
        self.dist[start] = 0

        # 最短経路での1つ前のノード
        self.prev = defaultdict(lambda: None)

        # startノードをキューに入れる
        self.Q = []
        heappush(self.Q, (self.dist[start], start))

        while self.Q:
            # 優先度（距離）が最小であるキューを取り出す
            dist_u, u = heappop(self.Q)
            if self.dist[u] < dist_u:
                continue
            for v, weight in self.g[u]:
                alt = dist_u + weight
                if self.dist[v] > alt:
                    self.dist[v] = alt
                    self.prev[v] = u
                    heappush(self.Q, (alt, v))

    def shortest_distance(self, goal):
        """
        startノードからgoalノードまでの最短距離
        """
        return self.dist[goal]

    def shortest_path(self, goal):
        """
        startノードからgoalノードまでの最短経路
        """
        path = []
        node = goal
        while node is not None:
            path.append(node)
            node = self.prev[node]
        return path[::-1]


g = Graph()
N, M = [int(i) for i in input().split()]


for i in range(M):
    u, v = [int(i) for i in input().split()]
    g.add_edge(u-1, v-1, 1)
    g.add_edge(u-1+N, v-1, 1)
    g.add_edge(u-1, v-1+N, 1)

d = Dijkstra(g, 0)

ans_n = 10 ** 6
ans_index = -1
for i in range(N):
    d = Dijkstra(g, i)
    ans_n_ = d.dist[i+N]

    if ans_n_ < ans_n:
        ans_index = i
        ans_n = ans_n_

if ans_n == 10 ** 6:
    print(-1)
else:
    d = Dijkstra(g, ans_index)
    ans = d.shortest_path(ans_index + N)
    ans.sort()
    print(ans_n)
    for j in range(ans_n):
        print(ans[j]+1)
(H, W) = map(int, input().split())
a = []
for i in range(H):
    a.append(list(map(int, input().split())))
#print("a: ")
#print(a)

odd_flag = []
for i in range(len(a)):
    odd_flag.append(list())
    for j in range(len(a[i])):
        if a[i][j]%2 != 0:
            odd_flag[i].append(True)
        else:
            odd_flag[i].append(False)
#print("odd_flag: ")
#print(odd_flag)

odd_sum = 0
for i in range(len(odd_flag)):
    odd_sum += odd_flag[i].count(True)
#print(odd_sum)

s_h = 0
s_w = 0
move_flag = False

def move(h, w):
    if h%2 == 0:
        if w == W-1:
            return (h+1, w)
        else:
            return (h, w+1)
    else:
        if w == 0:
            return (h+1, w)
        else:
            return (h, w-1)

N = 0
ans = ""
while odd_sum >= 2:
    # 移動先到着
    if move_flag is True and odd_flag[s_h][s_w] is True:
        move_flag = False
        (s_h, s_w) = move(s_h, s_w)
        odd_sum -= 2
        N += 1
    # 移動中
    elif move_flag is True and odd_flag[s_h][s_w] is False:
        ans += str(s_h+1) + " " + str(s_w+1) + " "
        (s_h, s_w) = move(s_h, s_w)
        ans += str(s_h+1) + " " + str(s_w+1) + "\n"
    # 移動すべきものなし
    elif move_flag is False and odd_flag[s_h][s_w] is False:
        (s_h, s_w) = move(s_h, s_w)
    # 移動元到着
    elif move_flag is False and odd_flag[s_h][s_w] is True:
        move_flag = True
        ans += str(s_h+1) + " " + str(s_w+1) + " "
        (s_h, s_w) = move(s_h, s_w)
        ans += str(s_h+1) + " " + str(s_w+1) + "\n"

print(N)
#print(ans[0:-1])
    



### FIXED CODE ###

(A, B) = map(int, input().split())
ans = "No"
for i in range(1, 3):
    if((A*B*i)%2 == 1):
        ans = "Yes"
print(ans)
S = raw_input()
S = int(S)

h = S / 3600
m = S - 3600*h
s = m % 60
m = m - s

S = str(h) + ???:??? + str(m) + ???:??? + str(s)
print S

### FIXED CODE ###

S = int(raw_input())

h = S / 3600
m = S - 3600*h
s = m % 60
m = (m - s)/60

print str(h) + ":" + str(m) + ":" + str(s)
N = int(input())
e = [[] for i in range(N)]
for i in range(1, N):
    u, v, w = map(int, input().split())
    e[u-1].append(v-1)
    e[v-1].append(u-1)
l = [-1 for i in range(N)]
def dfs(u, p, col):
    l[u] = col
    for v in e[u]:
        if v != p:
            dfs(v, u, 1 - col)
    
dfs(0, -1, 0)
for col in l:
    print(col)


### FIXED CODE ###

from collections import deque

N = int(input())
e = [[] for i in range(N)]
for i in range(1, N):
    u, v, w = map(int, input().split())
    e[u-1].append((v-1, w))
    e[v-1].append((u-1, w))
l = [-1 for i in range(N)]

q = deque()
l[0] = 0
q.append(0)
while (q):
    u = q.pop()
    for v, w in e[u]:
        if l[v] >= 0:
            continue
        if w % 2 == 0:
            l[v] = l[u]
        else:
            l[v] = 1 - l[u]
        q.append(v)

for col in l:
    print(col)
N = int(input())
H = map(int,input().split())

A = [0]*N
A[1] = abs(H[1] - H[0])

for i in range(2,N):
  on = A[i-1] + abs(H[i] - H[i-1])
  tw = A[i-2] + abs(H[i] - H[i-2])
  A[i] = min(on , tw)

print(A[N])


### FIXED CODE ###

N = int(input())
H = list(map(int,input().split()))

A = [0]*N
A[1] = abs(H[1] - H[0])

for i in range(2,N):
  on = A[i-1] + abs(H[i] - H[i-1])
  tw = A[i-2] + abs(H[i] - H[i-2])
  A[i] = min(on , tw)

print(A[N-1])
import math
a,b,c,d=map(int,input().split())
nc=b//c-(a-1)//c
nd=b//d-(a-1)//d
x=c*d//math.gcd(c,d)
ncd=b//x-(a-1)//x
#print(nc,nd,x,ncd)
print(b-a+1-nc-nd+ncd)


### FIXED CODE ###

a,b,c,d=map(int,input().split())
def gcd(a, b):
	while b:
		a, b = b, a % b
	return a  
nc=b//c-(a-1)//c
nd=b//d-(a-1)//d
x=c*d//gcd(c,d)
ncd=b//x-(a-1)//x
#print(nc,nd,x,ncd)
print(b-a+1-nc-nd+ncd)
docs = ''
while True:
    docs += (raw_input().lower())
    if docs[len(docs)-1] == '.':
        break
for ascii_num in range(97, 123):
    print '%s : %d' % (chr(ascii_num), docs.count(chr(ascii_num)))

### FIXED CODE ###

docs = ''
while True:
    try:
        s = raw_input()
    except:
        break
    docs += s.lower()
for ascii_num in range(97, 123):
    print '%s : %d' % (chr(ascii_num), docs.count(chr(ascii_num)))
dp = [[0] * 1001 for i in range(11)]
dp[0][0] = 1
for i in range(101):
    for j in range(9, -1, -1):
        for k in range(0, 1001 - i):
            dp[j + 1][k + i] += dp[j][k]

while True:
    n, s = map(int, raw_input().split())
    print dp[n][s]

### FIXED CODE ###

dp = [[0] * 1001 for i in range(11)]
dp[0][0] = 1
for i in range(101):
    for j in range(9, -1, -1):
        for k in range(0, 1001 - i):
            dp[j + 1][k + i] += dp[j][k]
 
while True:
    n, s = map(int, raw_input().split())
    if (n,s) == (0,0):
        break
    print dp[n][s]
N,K=map(int,input().split())
S=input()
S[K-1]=lower(S[K-1])
print(S)

### FIXED CODE ###

N,K=map(int,input().split())
S=list(input())
S[K-1]=S[K-1].lower()
S="".join(S)
print(S)
a =int(input())
b =int(input())

c = 100 * a + b
d=0

while d**2 < c:
  d=d+1
  if d*d == c:
    print('Yes')
    exit()
print('No')



### FIXED CODE ###

a, b = input().split()
n = int(a+b)
if n == int(n**(1/2))**2:
  print('Yes')
else:
  print('No')
import math
X=int(input())
count=0
atcor=100
p=0.01

while True:
    if atcor==X:
        print(count)
        break
    else:
        atcor=(atcor*p)+atcor
        atcor=math.floor(atcor)
        count+=1

### FIXED CODE ###

import math

X=int(input())
count=0
# count=float(count)
atcor=100
atcor=int(atcor)


while True:
    
    if atcor>=X:
        print(count)
        break
    else:
        p=atcor/100
        atcor=atcor+p
        atcor=math.floor(atcor)
        count+=1
k=int(input())
if k=25:
  print("Christmas")
if k=24:
  print("Christmas Eve")
if k=23:
  print("Christmas Eve Eve")
if k=22:
  print("Christmas Eve Eve Eve")

### FIXED CODE ###

k=int(input())
if k==25:
  print("Christmas")
if k==24:
  print("Christmas Eve")
if k==23:
  print("Christmas Eve Eve")
if k==22:
  print("Christmas Eve Eve Eve")
a = list(map(int,input().split()))
def judge(count):
  idx = 0
  for i in range(2,n+1):
    if count == -1:
      if sum(a[0:i]) < 0:
        pass
      else:
        check = sum(a[0:i]) + 1
        j = a[i-1]
        a[i-1] = j - check
        idx += check
    elif count == 1:
      if sum(a[0:i]) > 0:
        pass
      else:
        check = 1 - sum(a[0:i])
        j = a[i-1]
        a[i-1] = check+ j
        idx += check
    count *= -1
  return idx
if a[0] > 0:
  b = judge(-1)
  print(b)
elif a[0] < 0:
  c = judge(1)
  print(c)
else:
  a[0] = 1
  b = judge(-1)
  a[0] = -1
  c = judge(1)
  print(min(b,c))


### FIXED CODE ###

n = int(input())
a = list(map(int,input().split()))
ans1,ans2 = 0,0
sum1,sum2 = 0,0
for i in range(n):
    sum1 += a[i]
    if i%2 == 1 and sum1 >= 0:
        ans1 += sum1 + 1
        sum1 = -1
    elif i%2 == 0 and sum1 <= 0:
        ans1 += -sum1 + 1
        sum1 = 1
for i in range(n):
    sum2 += a[i]
    if i%2 == 0 and sum2 >= 0:
        ans2 += sum2 + 1
        sum2 = -1
    elif i%2 == 1 and sum2 <= 0:
        ans2 += -sum2 + 1
        sum2 = 1
print(min(ans1,ans2))
N,K = map(int, input().split())
ab_list = {}
for i in range(N):
    a,b = map(int, input().split())
    akagi=str(a)
    if akagi in ab_list:
        ab_list[akagi] += b
        print("if")
        print(ab_list)
    else:
        ab_list[akagi] = b
        print("else")
        print(ab_list)
        

  
        
count =0
for i in sorted(ab_list.items(), key=lambda x: x[0]):
    count+=i[1]
    if (count >= K):
        print(i[0])
        break


### FIXED CODE ###

N,K = map(int, input().split())
ab_list = []
for i in range(N):
    a = list(map(int, input().split()))
    ab_list.append(a)
    
ab_list.sort()
    
count =0
for i in ab_list:
    count+=i[1]
    if (count >= K):
        print(i[0])
        break
a, b = map(int, input().split())

print(int(a * b))

### FIXED CODE ###

from decimal import Decimal
import math
a, b = map(Decimal, input().split())

print(math.floor(a * b))
n = int(input())
# 最終的に出力する色
colors = [-1] * n
# 重み付き無向グラフ
conns = [set() for _ in [0] * n] 

for x in range(1, n):
  v1, v2, dis = map(int, input().split())
  # (接続ノード, 重み) を加える
  conns[v1-1].add((v2-1, dis))
  conns[v2-1].add((v1-1, dis))
  
def dfs(now: int, prev: int,  color: int):
  # 頂点に色を塗る
  colors[now] = color
  # 頂点から生える各エッジに対し
  for edge, w in conns[now]:
    # 親と一緒 -> 無視
    if edge == prev:
      continue
    # 偶数なら同色,奇数なら異色で塗る
    dfs(edge, now, 1-color) if w&1 else dfs(edge, now, color)

# 適当に根ノードを決め,グラフ彩色開始
dfs(0, -1, 1)

print('\n'.join(map(str, colors)))

### FIXED CODE ###

from collections import deque
n = int(input())
# 最終的に出力する色
colors = [-1] * n
# 重み付き無向グラフ
conns = [set() for _ in [0] * n] 

for x in range(1, n):
  v1, v2, dis = map(int, input().split())
  # (接続ノード, 重み) を加える
  conns[v1-1].add((v2-1, dis))
  conns[v2-1].add((v1-1, dis))

# BFSの為に根ノードを初期化. (基準ノード, 距離, 過去のノード)
q = deque([(0, 0, -1)])
# BFS開始
while q:
  v, dis, past = q.popleft()
  
  # 奇数なら1で,偶数なら0で塗る
  colors[v] = dis&1
  
  # 基準ノードから生える各エッジに対し
  for edge, w in conns[v]:
    
    # エッジが既に調べたものなら飛ばす
    if edge == past:
      continue
    # 根からここまでの距離を足しつつ,新しく探索先を追加.
    q.append((edge, dis + w, v))

print('\n'.join(map(str, colors)))
A, B = list(map(int, input().split()))

ans = 0
for i in range(A, B+1):
  buf = str(i)
  is_par = true
  for u in range(buf.size()//2):
    if buf[u] != buf[-1-u]:
      is_par = false
      break
  if is_par:
    ans += 1
print(ans)
    

### FIXED CODE ###

A, B = list(map(int, input().split()))

ans = 0
for i in range(A, B+1):
    buf = str(i)
    is_par = True
    for u in range(len(buf)//2):
        if buf[u] != buf[-1-u]:
            is_par = False
            break
    if is_par:
        ans += 1


print(ans)
li = list(map(int,input().split()))
mtx = [[] for _ in range(li[0])]
li_sum = []

for i in range(li[0]):
    mtx[i] = list(map(int,input().split()))
    print(mtx[i],sum(mtx[i]))
    
    for j in range(li[j]):
        li_sum[j] += mtx[i][j]
    li_sum[j] += sum(mtx[i])

print(' '.join(map(str,li_sum)))


### FIXED CODE ###

l, c = map(int, input().split())
tbl = [[] for _ in range(l)]
li_sum = [0 for _ in range(c+1)]

for i in range(l):
  a = input()
  tbl[i] = list(map(int, a.split()))
  print(a, end='')
  print(' ', sum(tbl[i]), sep ='')

  for j in range(c):
    li_sum[j] += tbl[i][j]
  li_sum[c] += sum(tbl[i])

print(' '.join(map(str, li_sum)))
import math
N = int(input())
N_sqrt = int(math.sqrt(N))

for i in range(1,N_sqrt):
    if N % i == 0:
        x = i
        y = int(N/i)

print(x+y-2)

### FIXED CODE ###

import math
N = int(input())
N_sqrt = int(math.sqrt(N))

for i in range(1,N_sqrt+1):
    if N % i == 0:
        x = i
        y = int(N/i)

print(x+y-2)
def main():
    n = int(input())
    h = [int(x) for x in input().split()]

    dp = [10000] * n
    dp[0] = 0

    for i in range(1, n):
        tmp = dp[i-1] + abs(h[i] - h[i - 1])
        if dp[i] > tmp:
            dp[i] = tmp
        if i > 1:
            tmp = dp[i - 2] + abs(h[i] - h[i - 2])
            if dp[i] > tmp:
                dp[i] = tmp

        print(dp)

    print(dp[n-1])

if __name__ == "__main__":
    main()

### FIXED CODE ###

def main():
    N = int(input())
    h = [int(x) for x in input().split()]

    dp = [float('inf')] * (2 * N)

    dp[0] = 0

    for i in range(1, N):
        dp[i] = min(dp[i], dp[i-1] + abs(h[i] - h[i-1]))
        if i > 1:
            dp[i] = min(dp[i], dp[i-2] + abs(h[i] - h[i-2]))

    print(dp[N-1])


if __name__ == "__main__":
    main()
n, m = map(int, input().split())
l = [0]*n

for _ in range(m):
    a, s = map(int, input().split())
    s = str(s)
    if (l[a-1] and l[a-1] != s) or (a==1 and s=="0"):
        l = -1
        break
    else:
        l[a-1] = s

if l == -1:
    print(l)
else:
    print("".join(l))

### FIXED CODE ###

n, m = map(int, input().split())
l = [0]*n

for _ in range(m):
    a, s = map(int, input().split())
    s = str(s)
    if n == 1 and (a==1 and s=="0"):
        l[0] = s
    elif (l[a-1] and l[a-1] != s) or (a==1 and s=="0"):
        l = [-1]
        break
    else:
        l[a-1] = s

num = "".join(map(str, l))

if num[0] == "0" and n != 1:
    print("1" + num[1:])
else:
    print(num)
import numpy as np
N = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))

mi = []
pl = []
sum = 0
if (np.sum(B) > np.sum(A)):
    print('-1')
    exit()

else:
    for i in range(N):
        s = A[i] - B[i]
        if s < 0:
            mi.append(-s)
        elif s > 0:
            pl.append(s)

            
pl.sort(reverse=True)
p = np.sum(mi)
if (p != 0) and (len(pl) != 0):
    count = 1
    for i in pl:
        if p-i > 0:
            p -= i
            count += 1
        else:
            break
        
    else:
        print('-1')
        exit()
elif(p == 0) and (len(pl) != 0):
    print('0')
else:
    count = 0

print(len(mi)+count)
        
    
    
    
    
            
        
            
    
    
        
    
    
    



        
        
    
        
    
            
    



### FIXED CODE ###

import numpy as np
N = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))

mi = []
pl = []

for i in range(N):
    s = A[i] - B[i]
    if s < 0:
        mi.append(s)
    elif s > 0:
        pl.append(s)

            
pl.sort(reverse=True)
p = np.sum(mi)



if (len(pl)>0)and(len(mi)>0):
    count = 0
    for i in pl:
        if p + i < 0:
            p += i
            count += 1
            continue
        else:
            count += 1
            break
    else:
        print('-1')
        exit()

    print(count + len(mi))
    
        
elif len(mi) == 0:
    print('0')
    exit()
else:
    print('-1')
    exit()
a = int(input()), b= int(input()), c=int(input())
print(a, b, c)

### FIXED CODE ###

A,B,C= map(int,input().split())
print(C,A,B)
N = int(input())
A=list(map(int, input().split()))

def sol(i,want):
    num=int(N/(i+1))
    wa=-A[0]
    for j in range(num):
        wa+=A[i+j*i]
    wa=wa%2
    if wa==want:
        x=0
    else:
        x=1
#     print(num)
    return x 

B=A[:]
for i in range(half):
    j=half-1-i
    print(j)
    B[j]=sol(j,A[j])

### FIXED CODE ###

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




def sol(i,want):
    num=N//(i+1)
    wa=B[i]

    for j in range(num):
        k=i+j*(i+1)
        wa+=B[k]
#         print(i,wa,B[i])
#         print((i+1)+j*(i+1)-1)
#     print(i,wa,B[i])
    wa=wa%2
#     print(i,wa,A[i])
    
    if wa==want:
        x=0
    else:
        x=1
#     print(num)
    return x 

B=A[:]
half=N//2
for i in range(half):
    j=half-1-i
#     print(j)
    B[j]=sol(j,A[j])
    
C=[i+1 for i, x in enumerate(B) if x ==1]

m=sum(B)
print(m)
print(*C)
n = int(input())
ba_list = []
for i in range(n):
    ba_tmp = list(map(int, input().split()))
    ba_list.append([ba_tmp[1], [ba_tmp[0]])
ba_list.sort()
now_time = 0
for i in range(n):
    now_time += ba_list[i][1]
    if now_time > ba_list[i][0]:
        print('No')
        exit()
print('Yes')

### FIXED CODE ###

n = int(input())
ba_list = []
for i in range(n):
    ba_tmp = list(map(int, input().split()))
    ba_list.append(ba_tmp[::-1])
ba_list.sort()
now_time = 0
for i in range(n):
    now_time += ba_list[i][1]
    if now_time > ba_list[i][0]:
        print('No')
        exit()
print('Yes')
n=int(input())

a=2
b=1


for i in range(n-1):
  nn = a+b
  ans=nn
  a=b
  b=nn

print(ans)

### FIXED CODE ###

n=int(input())
 
a=2
b=1
s=0
 
if n==1:
  s=1
  n=2
 
for i in range(n-1):
  nn = a+b
  ans=nn
  a=b
  b=nn
 
if s==1:
  ans = 1
 
print(ans)
def main():
    Ss = input()
    S = list(Ss)
    now = 0
    T = ''
    Sr = []
    for i in range(1,len(S)+1):
        Sr[-i] = S[i-1]

    while True:
        tmp5 = Sr[now:now+5]
        tmp6 = Sr[now:now+6]
        tmp7 = Sr[now:now+7]
        if tmp5[0] == 'e' and tmp5 == ['e','s','a','r','e']:
            T += 'erase'
            now += 5
        elif tmp5[0] == 'm' and tmp5 == ['m','a','e','r','d']:
            T += 'dream'
            now += 5
        elif tmp6[0] == 'r' and tmp6 == ['r','e','s','a','r','e']:
            T += 'eraser'
            now += 6
        elif tmp7[0] == 'r' and tmp7 == ['r','e','m','a','e','r','d']:
            T += 'dreamer'
            now += 7
        else:
            print('NO')
            return

        if now >= len(S):
            break
    if Ss == T:
        print('YES')
    else:
        print('NO')

if __name__ == '__main__':
    main()


### FIXED CODE ###

def main():
    Ss = input()
    S = list(Ss)
    now = 0
    T = ''
    Sr = []
    for i in range(1,len(S)+1):
        Sr.append(S[-i])
    ans = []
    while True:
        tmp5 = Sr[now:now+5]
        tmp6 = Sr[now:now+6]
        tmp7 = Sr[now:now+7]
        if tmp5[0] == 'e' and tmp5 == ['e','s','a','r','e']:
            ans.append('erase')
            now += 5
        elif tmp5[0] == 'm' and tmp5 == ['m','a','e','r','d']:
            ans.append('dream')
            now += 5
        elif tmp6[0] == 'r' and tmp6 == ['r','e','s','a','r','e']:
            ans.append('eraser')
            now += 6
        elif tmp7[0] == 'r' and tmp7 == ['r','e','m','a','e','r','d']:
            ans.append('dreamer')
            now += 7
        else:
            print('NO')
            
            return

        if now >= len(S):
            break
    for i in range(1,len(ans)+1):
        T += ans[-i]
    if Ss == T:
        print('YES')
    else:
        print('NO')

if __name__ == '__main__':
    main()
from itertools import product

n, m = map(int, input().split())
ks = [list(map(int, input().split())) for _ in range(m)]
p = list(map(int, input().split()))

cnt = 0
for pat in product([0, 1], repeat=n):
    for ksi, pi in zip(ks, pi):
        tmp = sum(pat[ksij - 1] for ksij in ksi[1:])
        if  tmp % 2 != pi:
            break
    else:
        cnt += 1
print(cnt)


### FIXED CODE ###

from itertools import product

n, m = map(int, input().split())
ks = [list(map(int, input().split())) for _ in range(m)]
p = list(map(int, input().split()))

cnt = 0
for pat in product([0, 1], repeat=n):
    for i in range(m):
        if sum(pat[ks[i][j + 1] - 1] for j in range(ks[i][0])) % 2 != p[i]:
            break
    else:
        cnt += 1

print(cnt)