Harryxun/stf_run huggingface dataset:
from fractions import gcd


def solve():
    N, M, *a = map(int, open(0).read().split())
    
    a_lcm = a[0]
    for i in range(1, N):
        a_lcm = (a_lcm * a[i]) // gcd(a_lcm, a[i])
    ans = 1 + (M - a_lcm / 2) // a_lcm
    if M < a_lcm / 2:
        ans = 0
    print(int(ans))


if __name__ == '__main__':
    solve()


### FIXED CODE ###

from fractions import gcd
from functools import reduce


def lcm(x, y):
    res = (x * y) // gcd(x, y)
    if 10 ** 9 < res:
        res = 0
    return res


def solve():
    N, M, *a = map(int, open(0).read().split())
    
    half_a = [ai // 2 for ai in a]
    half_lcm = reduce(lcm, half_a)
    
    for ai in half_a:
        if (half_lcm // ai) % 2 == 0:
            print(0)
            exit()
    
    if half_lcm == 0:
        ans = 0
    else:
        ans = (M // half_lcm) - (M // (2 * half_lcm))
    print(ans)


if __name__ == '__main__':
    solve()
H, W, A, B = list(map(int, input().split()))
for i in range(B):
    print('1' ＊ A+ '0' ＊ (W - A) )
for i in range(H - B):
    print('0' ＊A + '1'＊ (W - A) )

### FIXED CODE ###

H, W, A, B = list(map(int, input().split()))
for _ in range(B):
    print('0' * A + '1' * (W - A))
for _ in range(H - B):
    print('1' * A + '0' * (W - A))
#D
from collections import deque
Str = str(input())
Q = int(input())
S = deque()
S.append(Str)
A = 0
B = []
C = []

for i in range(Q):
    a = list(map(str, input().split()))
    if a[0] == '1':
        if A%2==0:
            if len(B)>1:
                B_=B.reverse()
                S.extendleft(B_)
                B = []
            else:
                S.extendleft(B)
                B = []
            S.extend(C)
            C = []
        else:
            if len(C)>1:
                C_=C.reverse()
                S.extendleft(C_)
                C = []
            else:
                S.extendleft(C)
                C = []
            S.extend(B)
            B = []
        A += 1
    elif a[1] == '1':
        B.append(a[2])
    else:
        C.append(a[2])

if a[0] != '1':
    if A%2==0:
        if len(B)>1:
            B_=B.reverse()
            S.extendleft(B_)
            B = []
        else:
            S.extendleft(B)
            B = []
        S.extend(C)
        C = []
    else:
        if len(C)>1:
            C_=C.reverse()
            S.extendleft(C_)
            C = []
        else:
            S.extendleft(C)
            C = []
        S.extend(B)
        B = []

if A%2 != 0:
    S.reverse()
print(''.join(S))


### FIXED CODE ###

#D
from collections import deque
Str = str(input())
Q = int(input())
S = deque(list(Str))
#S.append(list(Str))
#上の方法ではダメ
A = 0
B = []
C = []

for i in range(Q):
    a = list(map(str, input().split()))
    if a[0] == '1':
        if A%2==0:
            if len(B)>1:
                S.extendleft(B)
                B = []
            elif len(B) == 1:
                S.extendleft(B)
                B = []
            if len(C) > 0:
                S.extend(C)
                C = []
        else:
            if len(C)>1:
                S.extendleft(C)
                C = []
            elif len(C) == 1:
                S.extendleft(C)
                C = []
            if len(B) > 0:
                S.extend(B)
                B = []
        A += 1
    elif a[1] == '1':
        B.append(a[2])
    else:
        C.append(a[2])

if a[0] != '1':
    if A%2==0:
        if len(B)>1:
            S.extendleft(B)
            B = []
        elif len(B) == 1:
            S.extendleft(B)
            B = []
        if len(C) > 0:
            S.extend(C)
            C = []
    else:
        if len(C)>1:
            S.extendleft(C)
            C = []
        elif len(C) == 1:
            S.extendleft(C)
            C = []
        if len(B) > 0:
            S.extend(B)
            B = []

if A%2 != 0:
    S.reverse()
print(''.join(S))
a,b,c=input();print('YNeos'[a!=c::2])

### FIXED CODE ###

x,a,b = map(int,input().split())

if abs(x-b) < abs(x-a):
    print('B')
elif abs(x-a) < abs(x-b):
    print('A')
H,W,D=map(int,input().split())

dic={}
A=[]
for h in range(H):
    A.append(list(map(int,input().split())))
    for w in range(W):
        dic[A[h][w]]=[h,w]

Q=int(input())

c=[-1]*(H*W+1)
def rec(n):
    if c[n]!=-1:
        return [c[n]]
    y,x=dic[n]
    ny,nx=dic[n+D]
    ret=abs(y-ny)+abs(x-nx)
    c[n]=ret
    return ret

for i in range(Q):
    L,R=map(int,input().split())
    N=(R-L)//D
    ans=0
    for j in range(N):
        ans+=rec(L+D*j)
    print(ans)

### FIXED CODE ###

H,W,D=map(int,input().split())
A=[]

for h in range(H):
    A.append(list(map(int,input().split())))

pos= {}
for h in range(H):
    for w in range(W):
        pos[A[h][w]]=[h,w]

S=[0]*(H*W)
for d in range(D):
    tmp=0
    now=d+1
    while now+D<=H*W:
        nowh,noww=pos[now]
        newh,neww=pos[now+D]
        tmp+=abs(nowh-newh)+abs(noww-neww)
        S[now+D-1]=tmp
        now+=D

Q=int(input())
for i in range(Q):
    L,R=map(int,input().split())
    ans=S[R-1]-S[L-1]
    print(ans)
import numpy as np

n, m = map(int,input().split())
ac = [0]*(n+1)
ac = np.array(ac)
wa = [0]*(n+1)
wa = np.array(wa)

for i in range(m):
    p, s = map(str, input().split())
    p= int(p)
    if s == 'AC':
        ac[p] = 1
    elif ac[p] == 0:
        wa[p] += 1

wa= wa*ac
print(sum(ac), sum(wa))

### FIXED CODE ###

n, m = map(int,input().split())
ac = [0]*(n+1)
wa = [0]*(n+1)

for i in range(m):
    p, s = map(str, input().split())
    p= int(p)
    if s == 'AC':
        ac[p] = 1
    elif ac[p] == 0:
        wa[p] += 1

wa_sum = 0
for w, a in zip(wa, ac):
    wa_sum += w*a
print(sum(ac), wa_sum)
n = int(input())
s = input()
li = []
for i in range(n):
    if s[i] == "#":
        li.append(i)
sum = 0
if len(li) == 0:
    print(0)
for i in range(len(li)-1):
    sum += li[i+1]-li[i]-1 
sum += len(s) - li[-1] - 1
print(sum)



### FIXED CODE ###

n = int(input())
s = input()
li = []
for i in range(n):
    if s[i] == "#":
        li.append(i)
li.append(len(s))
sum = 0
if len(li) == 1:
    print(0)
else:
    for i in range(len(li)-1):
        diff = li[i+1] - li[i] - 1
        if sum + diff >= i+1:
            sum = i+1
        else:
            sum += diff
    print(sum)
num_input = [input() for i in range(2)]
x = int(num_input[0].split()[0])
n = int(num_input[0].split()[1])

num_list = [int(n) for n in num_input[1].split()]
num_list.sort()

ans=x

if len(num_list)!=0:
    index=num_list.index(6)
    index_left=index-1
    index_right=index+1
    value_left=x-1
    value_right=x+1
    
    for i in range(n):
        if num_list[index_left]!=value_left:
            ans=value_left
            break
        elif num_list[index_right]!=value_right:
            ans=value_right
            break
        index_left=index_left-1
        index_right=index_right+1
        value_left=value_left-1
        value_right=value_right+1

print(ans)

### FIXED CODE ###

num_input = [input() for i in range(2)]
x = int(num_input[0].split()[0])
n = int(num_input[0].split()[1])

num_list = [int(n) for n in num_input[1].split()]
num_list.sort()

ans=x

if n!=0 and n!=1 and n!=100:
    if x in num_list:
        index=num_list.index(x)

        value_left=x-1
        value_right=x+1

        if index!=0:
            index_left=index-1
        if index!=n-1:
            index_right=index+1
        
        if index==0:
            ans=x-1
        elif index==n-1:
            if num_list[index-1]==x-1:
                ans=x+1
            else:
                ans=x-1
        else:
            for i in range(n):
                if num_list[index_left]!=value_left:
                    ans=value_left
                    break
                elif num_list[index_right]!=value_right:
                    ans=value_right
                    break
                if index_left!=0:
                    index_left=index_left-1
                if index_right!=n:
                    index_right=index_right+1
                value_left=value_left-1
                value_right=value_right+1

if n==1:
    ans=x-1

if n==100:
    if x<=50:
        ans=0
    if x>50:
        ans=101

print(ans)
H = [0] + H
cnt = 0
for i in range(1, N + 1):
    cnt += max(H[i] - H[i - 1], 0)


print(cnt)


### FIXED CODE ###

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

ans = 0
zero = 0

for h in H:
    if h == 0:
        zero += 1

while zero < N:
    flg = False
    cnt = 0

    for i in range(N):
        if H[i] > 0:
            flg = True
            H[i] -= 1

            if H[i] == 0:
                zero += 1
        else:
            if flg:
                cnt += 1
                flg = False

    if flg:
        cnt  += 1

    ans += cnt


print(ans)
from itertools import accumulate

n, k = map(int, input().split())
p = list(map(int, input().split()))
c = list(map(int, input().split()))
p = [i-1 for i in p]

seen = [False]*n
ans = -float('inf')
for i in range(n):
    if not seen[i]:
        sc = []
        stop = i
        while True:
            seen[i] = True
            sc.append(c[i])
            if p[i] == stop:
                break
            i = p[i]

        lens = len(sc)
        for j in range(lens):
            if j != 0:
                sc = sc[1:] + [sc[0]]
            ac = list(accumulate(sc))

            if sum(sc) <= 0:
                ans = max(ans, max(ac[:min(k, lens)]))
            else:
                if k%lens == 0:
                    ans = max(ans, ac[-1]*(k//lens-1) + max(ac))
                else:
                    ans = max(ans, ac[-1]*(k//lenc) + max(ac[:k%lenc]+[0]))
print(ans)

### FIXED CODE ###

from itertools import accumulate
import sys
sys.setrecursionlimit(10**6)
n, k = map(int, input().split())
p = list(map(int, input().split()))
c = list(map(int, input().split()))

def dfs(G, v, p):
    seen[v] = True
    sc.append(c[v])

    for nv in G[v]:
        if nv == p:
            continue
        if seen[nv]:
            pos[0] = nv
            return

        dfs(G, nv, v)
        if pos[0] != -1:
            return


G = [[] for _ in range(n)]
for i in range(n):
    G[i].append(p[i]-1)

seen = [False]*n
ans = -float('inf')
for i in range(n):
    if seen[i] == False:
        pos = [-1]
        sc = []
        dfs(G, i, -1)

        if sc:
            sumsc = sum(sc)
            lenc = len(sc)
            for j in range(lenc):
                if j != 0:
                    sc = sc[1:] + [sc[0]]
                ac = list(accumulate(sc))
                
                if sumsc <= 0:
                    ans = max(ans, max(ac[:min(k, lenc)]))
                else:
                    if k%lenc == 0:
                        ans = max(ans, ac[-1]*(k//lenc - 1) + max(ac))
                    else:
                        ans = max(ans, ac[-1]*(k//lenc) + max(ac[:k%lenc]))
print(ans)
N=int(input())
A=list(map(int,input().split()))

DP=[[-10**16 for i in range(N)]for j in range(3)]

DP[1][0]=0
DP[2][0]=0
DP[2][1]=0
DP[0][0]=A[0]
DP[1][1]=A[1]
DP[2][2]=A[2]

for i in range(2,N):
    DP[0][i]=DP[0][i-2]+A[i]
    DP[1][i]=DP[1][i-2]+A[i]
    DP[2][i]=DP[2][i-2]+A[i]
    if i-3>=0:
        DP[1][i]=max(DP[1][i],DP[0][i-3]+A[i])
        DP[2][i]=max(DP[2][i],DP[1][i-3]+A[i])
    if i-4>=0:
        DP[2][i]=max(DP[2][i],DP[0][i-4]+A[i])

if N%2==0:
    print(max(DP[0][-2],DP[1][-1]))
else:
    print(max(DP[0][-3],DP[1][-2],DP[2][-1]))

### FIXED CODE ###

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

DP=[[-10**16 for i in range(N)]for j in range(3)]

DP[1][0]=0
DP[2][0]=0
DP[2][1]=0
DP[0][0]=A[0]
DP[1][1]=A[1]
if N>=3:
    DP[2][2]=A[2]

for i in range(2,N):
    DP[0][i]=DP[0][i-2]+A[i]
    DP[1][i]=DP[1][i-2]+A[i]
    DP[2][i]=DP[2][i-2]+A[i]
    if i-3>=0:
        DP[1][i]=max(DP[1][i],DP[0][i-3]+A[i])
        DP[2][i]=max(DP[2][i],DP[1][i-3]+A[i])
    if i-4>=0:
        DP[2][i]=max(DP[2][i],DP[0][i-4]+A[i])

if N%2==0:
    print(max(DP[0][-2],DP[1][-1]))
else:
    print(max(DP[0][-3],DP[1][-2],DP[2][-1]))
N, M = map(int,input().split())
A = list(map(int,input().split()))

for _ in range(M):
    B, C = map(int,input().split())
    A += [C]*B
    A.sort(reverse=True)
    A = A[:N]
print(sum(A))

### FIXED CODE ###

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

if 13 <= A:
    print(B)
elif 6 <= A:
    print(B//2)
else:
    print(0)
# coding: utf-8
import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

def main():
    # 約数
    N = ir()
    A = lr()
    A.sort()
    answer = 0
    bl = [0] * (A.max()+1)

    def make_divisors(n):  # nの約数を列挙
        divisors = []
        for i in range(1, int(n**0.5)+1):
            if n % i == 0:
                divisors.append(i)
                if i != n // i:
                    divisors.append(n//i)
        divisors.sort()
        return divisors

    for i, a in enumerate(A):
        if i < N-1 and a == A[i+1]:
            bl[a] = 1
            continue
        divs = make_divisors(a)
        flag = True
        for x in divs:
            if bl[x] == 1:
                flag = False
                break
        bl[a] = 1
        if flag:
            answer += 1

    print(answer)

main()

### FIXED CODE ###

# coding: utf-8
import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

N = ir()
A = lr()
A.sort()
bl = [True] * (A[-1]+1)
answer = 0
for i, a in enumerate(A):
    if i < N-1 and A[i+1] == a:
        pass
    elif bl[a]:
        answer += 1
    if bl[a]:
        bl[a] = False
        next = a + a
        while next <= A[-1]:
            bl[next] = False
            next += a

print(answer)
s = input()
k = int(input())
ans = 1
if k =< len(s):
    if s[:k] == "1" * k:
        ans = 1
    else:
        ans = int(s[k-1])
else:
    for i in range(len(s)):
        if s[i] != "1":
            ans = int(s[i])
            break
print(ans)

### FIXED CODE ###

s = input()
k = int(input())
ans = 1
if k <= len(s):
    if s[:k] == "1" * k:
        ans = 1
    else:
        for i in range(len(s)):
            if s[i] != "1":
                ans = int(s[i])
                break
else:
    for i in range(len(s)):
        if s[i] != "1":
            ans = int(s[i])
            break
print(ans)
import decimal

a, b, c = map(int, input().split())
a = decimal.Decimal(a)
b = decimal.Decimal(b)
b = decimal.Decimal(b)

if 4*a*b - (c-a-b)**2 < 0:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

a = [0,1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]

print(a[int(input())])
n,m=map(int,input().split())
points=list(map(int,input().split()))
points.sort()
score=0
score=points[-1]-points[0]

sas=[]
for i in range(0,m-1):
  sas.append(points[i+1]-points[i])

if sas==[]:
  print(0)
  exit()

for j in range(0,n-1):
  score-=max(sas)
  sas.remove(max(sas))

print(score)

### FIXED CODE ###

n,m=map(int,input().split(" "))
points=list(map(int,input().split(" ")))
points.sort()
score=0
#score=points[-1]-points[0]
sas=[]

for i in range(0,m-1):
  sas.append(points[i+1]-points[i])
sas.sort()

#score-=sum(sas[-n+1:]) 
if n>=m:
  print(0)
  exit()
else:
  print(sum(sas[:m-n]))
list_alpha = [chr(ord('a') + i) for i in range(26)]
c = input()
index = list_alpha.find(c)
print(list_alphs[index + 1])

### FIXED CODE ###

list_alpha = [chr(ord('a') + i) for i in range(26)]
c = input()
index = list_alpha.index(c)
print(list_alpha[index + 1])
import math
a=input().split()
print(math.gcd(a[0], a[1]))

### FIXED CODE ###

import fractions
a=input().split()
print(int(a[0]) * int(a[1]) // fractions.gcd(int(a[0]), int(a[1])))
s = input()
t = input()

s = s*ceil(len(t)/len(s))
s = s.count(t)

### FIXED CODE ###

from collections import defaultdict
def Z(S):
    res = [0]*len(S)
    res[0] = len(S)
    i = 1
    j = 0
    while i < len(S):
        while i+j < len(S) and S[j] == S[i+j]:
            j += 1
        res[i] = j
        if j == 0:
            i += 1
            continue
        k = 1
        while i+k < len(S) and k+res[k] < j:
            res[i+k] = res[k]
            k += 1
        i += k
        j -= k
    return res

class UnionFind:
    def __init__(self, num):
        self.table = [-1 for _ in range(num)]

    def find(self, x):
        if self.table[x] < 0:
            return x
        else:
            self.table[x] = self.find(self.table[x])
            return self.table[x]

    def union(self, x, y):
        s1 = self.find(x)
        s2 = self.find(y)

        if s1 != s2:
            if self.table[s1] <= self.table[s2]:
                self.table[s1] += self.table[s2]
                self.table[s2] = s1
            else:
                self.table[s2] += self.table[s1]
                self.table[s1] = s2
            return True
        return False

s = input()
t = input()

S = s*(len(t)//len(s)+2)
z = Z(t+'*'+S)
z = z[len(t)+1:]

u = UnionFind(len(s))

for i in range(len(s)):
    j = (i+len(t))%len(s)
    if z[i] == len(t) and z[j] == len(t):
        u.union(i,j)

d = defaultdict(list)
for i in range(len(s)):
    if z[i] == len(t):
        d[u.find(i)].append(i)

ans = 0
for k in d:
    loop = True
    if len(d[k])==1:
        loop = len(t)%len(s)==0
    else:
        for i in d[k]:
            j = (i+len(t)*(len(d[k])-1))%len(s)
            loop = z[j]==len(t) and loop
    if loop:
        ans = -1
        break
    ans = max(ans,len(d[k]))

print(ans)
N = int(input())
S = input()
K = int(input())

ans = ""
for c in S:
    if S[K] != c:
        ans += '*'
    else:
        ans += c

print(ans)

### FIXED CODE ###

N = int(input())
S = input()
K = int(input())
 
ans = ""
for c in S:
    if S[K-1] != c:
        ans += '*'
    else:
        ans += c
 
print(ans)
N,K,M = input().split()
N = int(N)
K = int(K)
M = int(N)
A = input().split()
A = [int(s) for s in A]
AN = M * N - sum(A)
if (AN <= K) and (AN >= 0):
	print (AN)
else:
	print ('-1')

### FIXED CODE ###

a = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
C = input()
if (C != 'z') and (C in a):
	i = a.index(C)
	print (a[i+1])
# E

# 入力
# input
N = int(input())
a_list = [0]*(N+1)
for i in range(N+1):
    a_list[N-i] = int(input())


# 10^5までの素数を計算
# list primes <= 10^5 
primes = list(range(10**5))
primes[0] = 0
primes[1] = 0
for p in range(2, 10**5):
    if primes[p]:
        for i in range(2*p, 10**5, p):
            primes[i] = 0
primes = [p for p in primes if p>0]
p_list = [p for p in primes if p <= N]


# A_Nを素因数分解、Nより大きい素因数をp_listに追加
# A_N, ..., A_0の最大公約数の素因数でやっても同じ
# list prime factors of A_N, if greater then N, add to p_list
# you can use prime factors of gcd(A_N, ..., A_0) instead 

p_list = []
A = abs(a_list[-1])
for p in primes:
    if A % p == 0:
        if p > N:
            p_list.append(p)
        while A % p == 0:
            A = A // p
if A != 0:
    p_list.append(A)

# 個別に条件確認
# check all p in p_list
# x^p ~ x (mod p)
res_list = []
for p in p_list:
    r = 0
    check_list = [0]*(N+1)
    for i in range(p):
        check_list[i] = a_list[i]
    for i in range(p, N+1):
        check_list[(i-1) % (p-1) + 1] += a_list[i]
    for i in range(p):
        if check_list[i] % p != 0:
            r = 1
    if r == 0:
        res_list.append(p)

for p in res_list:
    print(p)

### FIXED CODE ###

# E

# 入力
# input
N = int(input())
a_list = [0]*(N+1)
for i in range(N+1):
    a_list[N-i] = int(input())


# 10^5までの素数を計算
# list primes <= 10^5 
primes = list(range(10**5))
primes[0] = 0
primes[1] = 0
for p in range(2, 10**5):
    if primes[p]:
        for i in range(2*p, 10**5, p):
            primes[i] = 0
primes = [p for p in primes if p>0]
# primes <= N
p_list_small = [p for p in primes if p <= N]


# A_Nを素因数分解、Nより大きい素因数をp_list_largeに追加
# A_N, ..., A_0の最大公約数の素因数でやっても同じ
# list prime factors of A_N, if greater then N, add to p_list_large
# you can use prime factors of gcd(A_N, ..., A_0) instead 

p_list_large = []
A = abs(a_list[-1])
for p in primes:
    if A % p == 0:
        if p > N:
            p_list_large.append(p)
        while A % p == 0:
            A = A // p
if A != 1:
    p_list_large.append(A)

# 個別に条件確認
# check all p in p_list_small
# x^p ~ x (mod p)
res_list = []
for p in p_list_small:
    r = 0
    check_list = [0]*(N+1)
    for i in range(p):
        check_list[i] = a_list[i]
    for i in range(p, N+1):
        check_list[(i-1) % (p-1) + 1] += a_list[i]
    for i in range(p):
        if check_list[i] % p != 0:
            r = 1
    if r == 0:
        res_list.append(p)
        
# 個別に条件確認
# check all p in p_list_large
# a_i % p == 0
for p in p_list_large:
    r = 0
    for i in range(N+1):
        if a_list[i] % p != 0:
            r = 1
    if r == 0:
        res_list.append(p)
        
for p in res_list:
    print(p)
import sys

sys.setrecursionlimit(10 ** 7)
f_inf = float('inf')
mod = 10 ** 9 + 7


def resolve():
    n = int(input())
    A = sorted(list(map(int, input().split())))

    if n == 1:
        print(1)
    else:
        L = []
        for i in range(n):
            L.append(list(range(A[i] - 1, A[i] + 2)))

        ma = L[-1][-1]
        mi = L[0][0]
        res = [0] * (ma - mi + 1)
        for l in L:
            for i in l:
                res[i] += 1

        print(max(res))


if __name__ == '__main__':
    resolve()


### FIXED CODE ###

import sys

sys.setrecursionlimit(10 ** 7)
f_inf = float('inf')
mod = 10 ** 9 + 7


def resolve():
    n = int(input())
    A = sorted(list(map(int, input().split())))

    if n == 1:
        print(1)
    else:
        L = []
        for i in range(n):
            L.append(list(range(A[i] - 1, A[i] + 2)))

        ma = L[-1][-1]
        mi = L[0][0]
        res = [0] * (ma - mi + 1)
        for l in L:
            for i in l:
                res[i - mi] += 1

        print(max(res))


if __name__ == '__main__':
    resolve()
import sys
sys.setrecursionlimit(10**9)
mod=10**9+7
m,n=map(int,input())
grid=[list(input()) for _ in range(n)]
cache={}
def dp(i,j):
  if i<0 or j<0 or i>=len(grid) or j>=grid[0] or grid[i][j]=='#':
    return 0
  elif (i,j) in cache:
    return cache[(i,j)]
  elif i==m-1 and j==n-1:
    return 1
  cache[(i,j)]=dp(i+1,j)+dp(i,j+1)
  return cache[(i,j)]

print(dp(0,0)%mod) 
  

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**9)
mod=10**9+7
m,n=map(int,input().split())
grid=[list(input()) for _ in range(m)]
cache={}
def dp(i,j):
  if i<0 or j<0 or i>=len(grid) or j>=len(grid[0]) or grid[i][j]=='#':
    return 0
  elif (i,j) in cache:
    return cache[(i,j)]
  elif i==m-1 and j==n-1:
    return 1
  cache[(i,j)]=dp(i+1,j)+dp(i,j+1)
  return cache[(i,j)]

print(dp(0,0)%mod)
import time

sec = int(intput())

print((Time.parse("1/1") + (sec - day * 86400)).strftime("%H:%M:%S:"))

### FIXED CODE ###

sec = int(input())
h = int(sec / 3600)
m = int((sec - 3600 * h) / 60)
s = sec - 3600 * h - 60 * m
print(str(h) + ":" + str(m) + ":" + str(s))
num = list(map(int, input().split()))
a = num[0]
b = num[1]
c = num[2]

if a%3 == 0 or b%3 == 0 or (a+b) %3 ==0 :
	print('Possible')
else:
	print('Impossible')
	

### FIXED CODE ###

num = list(map(int, input().split()))
a = num[0]
b = num[1]

if a%3 == 0 or b%3 == 0 or (a+b) %3 ==0 :
	print('Possible')
else:
	print('Impossible')
n, k = map(int, input().split())
hs = list(map(int, input().split()))
dp=[0]*n
dp[0]=0
for i, hi in enumerate(hs):
    if i == 0:
        continue
    s = max(0, i-k)
    dp[i] = min([ml + abs(hl - hi) for ml, hl in zip(dp[s:i], hs[s:i])])
print(dp[-1])


### FIXED CODE ###

n=int(input())
h=[10**6]+list(map(int,input().split()))
c=[0]*(n+1)
for i in range(2,n+1):
  a=c[i-1]+abs(h[i]-h[i-1])
  b=c[i-2]+abs(h[i]-h[i-2])
  c[i]=min(a,b)
print(c[n])
n,x = map(int,input().split())
m = []
for i in range(n):
    m += map(int,input().split())
print(n + (x - sum(m)) // min(m))

### FIXED CODE ###

S = list(input())
price = 700
for i in range(len(S)):
    if S[i] == "o":
        price += 100
print(price)