peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Wrong Answer
def resolve():
    '''
    code here
    '''
    s = int(input())
    is_not_found = True
    cnt = 0
    while is_not_found:
        cnt += 1
        if s == 4:
            is_not_found = False
        else:
            if s % 2 == 0:
                s //= 2
            else:
                s = 3*s + 1
        
    print(cnt+3)


if __name__ == "__main__":
    resolve()
# Judge status: Accepted
print(eval('0--~-'+''.join([i if i!=' ' else '//~-' for i in input()])))
# Judge status: Accepted
a,b = map(int,input().split())
if a<=b:
    print(a)
else:
    print(a-1)
# Judge status: Wrong Answer
import sys
r,g,b = map(int,input().split())
k = int(input())
#青＞緑＞赤
count = 0
if g*(2**k)>r:
    while g<r:
        g*=2
        count += 1
else:
    print("No")
    sys.exit()

if b*(2**(k-count))>g:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
N= int(input())
L0=2
L1=1
if N == 0:
  print(2)
elif N == 1:
  print(1)
else:
  for i in range(2,N+1):
    L=L0+L1
    L0 = L1
    L1 = L
  print(L)
# Judge status: Wrong Answer
n=input()
if(n[-1]=='e'):
  n+='s'
else:
  n+='es'
print(n)
# Judge status: Wrong Answer
k = int(input())
s = input()

if( len(s) <= k):
    print(s)
else:
    res = s[0:7] + "..."
    print(res)
# Judge status: Accepted
def resolve():
    '''
    code here
    '''
    num_S, num_c  = [int(item) for item in input().split()]

    delta = num_c - num_S *2
    scc = 0
    if num_S != 0:
        if num_c // 2 <= num_S :
            scc = num_c//2
        else:
            scc = num_S
            scc += delta//4
    else:
        scc = num_c//4

    print(scc)

if __name__ == "__main__":
    resolve()
# Judge status: Wrong Answer
def gcd(a,b):
    if a<b:
        a,b = b,a
    if b==0:
        return a
    else:
        return gcd(b,a%b)

n = int(input())
li = [int(input()) for _ in range(n)]

ans = 1
for i in range(n):
    ans = gcd(ans,li[i])
print(ans)
# Judge status: Accepted
a = list(input())
b = list(reversed(a))
ans_f = 0
ans_r = 0
for i in range(len(a)-1):
  if a[i] == a[i+1]:
    a[i+1] = str(abs(int(a[i]) - 1))
    ans_f += 1
for i in range(len(a)-1):
  if b[i] == b[i+1]:
    b[i+1] = str(abs(int(b[i]) - 1))
    ans_r += 1
print(min(ans_f,ans_r))
# Judge status: Wrong Answer
N = int(input())
vlist = sorted(list(map(int, input().split())))[::-1]
for _ in range(N-1):
    vlist.insert(0, (vlist.pop(0)+vlist.pop(0))/2)
print(vlist[0])
# Judge status: Accepted
n = int(input())
l = [0]*87
l[0] = 2
l[1] = 1

for i in range(2,87):
    tmp = l[i-2] + l[i-1]
    l[i] = tmp

print(l[n])
# Judge status: Accepted
import fractions
import math
 
def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)
 
 
n, m = list(map(int, input().split()))
a = list(map(lambda x: int(x) // 2, input().split()))
lcm_all = 1
for e in a:
    lcm_all = lcm(lcm_all, e)
    if (lcm_all // e) % 2 == 0:
        print(0)
        exit()
print(math.ceil((m // lcm_all) / 2))
# Judge status: Wrong Answer
s=input()
t=input()

u=sorted([s])
v=sorted([t])

print("Yes" if u<v else "No")
# Judge status: Accepted
N = int(input())

v = sorted(list(map(int,input().split())))

for p in range(N-1):
    v[p+1] = (v[p]+v[p+1])/2

print(v[N-1])
# Judge status: Accepted
import sys
a=sys.stdin.readline()
res = [int(i) for i in a.split(" ")] 
N,L = [res[i] for i in (0,1)]
flavour1=0
if (N>=2 and N<=200) and (L>=-100 and L<=100) and type(N)==int and type(L)==int:
    a1=[x for x in range(1,N+1)]
    b=[(L+i-1) for i in a1]
    for i in a1:
        flavour1+=b[i-1]
    c=[abs(x) for x in b]
    d=min(c)
    e=c.index(d)
    print((flavour1)-(b[e]))
else:
    print("Error")
# Judge status: Accepted
import queue

k = int(input())

q = queue.Queue()
for i in range(1,10):
    q.put(i)

for i in range(k):
    x = q.get()

    p = 10 * x  
    m = x % 10
    if not m == 0:
        q.put(p + m - 1)

    q.put(p + m)

    if not m == 9:
        q.put(p + m + 1)
    
print(x)
# Judge status: Accepted
N=int(input())

print((N-1)*N//2)
# Judge status: Wrong Answer
n=int(input())
p=list(map(int,input().split()))
print(p)
sum=0
for i in range(1,n-1):
    if p[i]>=p[i-1] and p[i]<=p[i+1]:
        sum+=1
    elif p[i]>=p[i+1] and p[i]<=p[i-1]:
        sum+=1

print(sum)
# Judge status: Accepted
N,M=map(int,input().split())

if N >= 2*M:
  print(M//2)
  exit()
  
def f(x):
  return max(min(N+x, (M-2*x)//2),0)
  
delta = [-3,-2,-1,0,1,2,3]
x = (M-2*N)//4

ans = 0
for i in range(7):
  x_ = max(0,x+delta[i])
  ans = max(ans,f(x_))

print(ans)
# Judge status: Accepted
x,y=map(int,input().split())
ans=0
while x<=y:
    ans+=1
    x*=2
print(ans)
# Judge status: Wrong Answer
n = int(input())
for i in range(n, 0, -1):
  if isinstance(i ** 0.5, int):
    print(i)
    break
# Judge status: Accepted
a = input()
b = input()

list = ['1', '2', '3']

list.remove(a)
list.remove(b)

print(*list)
# Judge status: Accepted
N = int(input())

ans = 10 ** N - (9 ** N * 2 - 8 ** N)
print(ans % (10 ** 9 + 7))
# Judge status: Wrong Answer
S = str(input())
N = len(S)

def f():
    for erase in range(2, N + 1, 2):
        new = S[0 : N - erase]
        flg = 1
        for i in range((N - erase) // 2):
            if new[i] != new[(N - erase) // 2 + i]: flg = 0
            break
        if not flg: continue
        return len(new)

print(f())
# Judge status: Wrong Answer
X, Y = map(int, input().split())

turu = (4 * X - Y) / 2

if turu.is_integer() and turu > 0:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
N,M=map(int,input().split())
L=[]
R=[]
for i in range(M):
  l,r=[int(i) for i in input().split()]
  L.append(l)
  R.append(r)
Lmax=max(L)
Rmin=min(R)
if Rmin-Lmax>=0:
  print(Rmin-Lmax+1)
else:
  print(0)
# Judge status: Accepted
N, M = [int(_) for _ in input().split()]
P = [0 for _ in range(N)]

ans,pen = 0,0
for _ in range(M):
    p,s = input().rstrip().split(' ')
    p = int(p) - 1
    if P[p] == -1:
        continue
    if s == "WA":
        P[p] += 1
    else:
        ans += 1
        pen += P[p]
        P[p] = -1
print(ans,pen)
# Judge status: Accepted
n = int(input())
A = [int(i) for i in input().split()]
B = [int(i) for i in input().split()]
total = 0
for i in range(n):
    if B[i] >= A[i]:
        total += A[i]
        B[i] -= A[i]
        if A[i+1] < B[i] :
            total += A[i+1]
            A[i+1] = 0
        else:
            total+= B[i]
            A[i+1] -= B[i]
    else:
        total += B[i]
print(total)
# Judge status: Wrong Answer
S,T=input().split()
A,B=map(int,input().split())
U=input()
if U==S:
  print(str(A-1))
else:
  print(str(B-1))
# Judge status: Accepted
test = str(input())
if test[2] == test[3] and test[4] == test[5]:
  print('Yes')
else:
  print('No')
# Judge status: Wrong Answer
N = int(input())
A = list(map(int, input().split()))

if all([n%2==0 for n in A]):
    print(min(A))
elif any([n%2==1 for n in A]):
    print(1)
elif all([n%2==1 for n in A]):
    print(min(A))
elif all([n == A[0] for n in A]):
    print(A[0])
# Judge status: Accepted
a,b,c = input().split()

if a == b and a == c:
	print(1)
elif a ==b and a != c:
	print(2)
elif b == c and b != a:
	print(2)
elif c ==a and c != b:
	print(2)
elif a != b and b != c and c != a:
	print(3)
# Judge status: Wrong Answer
N=int(input())
l=[]
for i in range(N):
  a=input()
  l.append(a)
AC_num=l.count("AC")
WA_num=l.count("WA")
TLE_num=l.count("TLE")
RE_num=l.count("RE")
print("AC ×",AC_num)
print("WA ×",WA_num)
print("TLE ×",TLE_num)
print("RE ×",RE_num)
# Judge status: Accepted
h, n = map(int, input().split())
l = list(map(int, input().split()))

if sum(l) >= h:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
n,k,s = map(int,input().split())
if s < 10 ** 9:
    z = ((str(s) + ' ') * k) + ((str(s+1) + ' ') * (n-k))
else:
    z = ((str(s) + ' ') * k) + (('1' + ' ') * (n-k))
print(z)
# Judge status: Accepted
n=int(input())
XL=[]
for i in range(n):
  x,l=map(int,input().split())
  XL.append([x-l,x,x+l])
ans=0
cur=-float("inf")
XL.sort(key=lambda x:x[2])
for x1,x2,x3 in XL:
  if x1>=cur:
    cur=x3
    ans+=1
  else:
    continue
print(ans)
# Judge status: Accepted
s = input()
if ('N' in s) ^ ('S'in s) or ('W' in s) ^ ('E' in s):
    print('No')
else:
    print('Yes')
# Judge status: Wrong Answer
N = int(input())
D = [list(map(int, input().split())) for i in range(N)]
if 3 < N:
    for i in range(N-3):
        if D[i][0] == D[i][1]:
            if D[i+1][0] == D[i+1][1] and D[i+2][0] == D[i+2][1]:
                print('Yes')
                exit()
else:
    print('No')
    exit()
print('No')
# Judge status: Accepted
n=int(input());a=list(map(int,input().split()));m=float('inf')
for i in range(1,n): m=min(m,abs(sum(a[:i])-sum(a[i:])))
print(m)
# Judge status: Accepted
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    S = readline().strip()

    if S[0] != 'A':
        print('WA')
        return

    if S[2 : len(S) - 1].count('C') != 1:
        print('WA')
        return

    if sum(1 for c in S if c.isupper()) != 2:
        print('WA')
        return

    print('AC')
    return


if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
n=int(input())
a=[int(i) for i in input().split()]
cur=0
ans=10000
b=-1
while(True):
    b+=1
    for i in range(n):
        cur+=abs(a[i]-(b+(i+1)))
    if(ans>cur):
        ans=cur
    else:
        break
print(ans)
# Judge status: Accepted
from collections import Counter

if __name__ == '__main__':
    MOD = 998244353
    n = int(input())
    d = list(map(int, input().split()))
    if d[0] != 0:
        print(0)
        exit(0)
    c = Counter(d)
    if c[0] != 1:
        print(0)
        exit(0)
    ans = 1
    for i in range(n - 1):
        ans *= pow(c[i], c[i + 1], MOD)
        ans %= MOD
    print(ans)
# Judge status: Accepted
S = input()
N = len(S)
if S == S[::-1] and  S[:(N-1)//2] == S[(N-3)//2::-1] and S[(N+1)//2:] == S[:(N-1)//2:-1] :
  print('Yes')
else:
  print('No')
# Judge status: Accepted
A = [int(x) for x in input().split()]
if sum(A) >= 22:
    print("bust")
else:
    print("win")
# Judge status: Wrong Answer
#coding:utf-8
w = input()

if len(w) % 2 != 0:
    print('No')
    exit()
else:
    for i in range(len(w)):
        if w.count(w[i]) % 2 != 0:
            print('No')
            break

print('Yes')
# Judge status: Wrong Answer
n,m,k = map(int,input().split())
nya = False
for i in range(n+1):
    for j in range(m+1):
        if i*n + j*m - 2*i*j == k:
            nya = True
            break
if nya:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
a = int(input())
b = int(input())
h = int(input())

print((a+b)/2*h)
# Judge status: Accepted
n,a,b = map(int,input().split())
ans2 = 0
for i in range(1,n+1):
    ans = 0
    for j in str(i):
        ans += int(j)
    if ans >= a and ans <= b:
        ans2 += i
print(ans2)
# Judge status: Wrong Answer
from collections import deque

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

A.sort(reverse=True)
A = deque(A)
res = 0
C = A.popleft()

for n in range(N-1):
    res += C
    C = A.popleft()
print(res)
# Judge status: Accepted
a, b = map(int, input().split())
m = (a + b + 1) / 2
print(int(m))
# Judge status: Wrong Answer
import math

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

A.sort(reverse=True)

comfortPoint = A[0]

for i in range(N)[1::]:
    comfortPoint += A[math.ceil(i/2)]

print(comfortPoint)
# Judge status: Accepted
import sys
N,K = map(int,input().split())
if not (1 <= N <= 100 and 1 <= K <= 100):
    sys.exit()

print(0) if N % K == 0 else print(1)
# Judge status: Wrong Answer
s = list(input())

if len(s)%2!=0:
  point = int((len(s)-1)/2)
  count = 0
  for i in range(1,int((len(s)-1)/2+1)):
    if s[point-i]!=s[point+i]:
      count += 1
  print(count)
  exit()
elif len(s)%2==0:
  point1 = int(len(s)/2-1)
  point2 = int(len(s)/2)
  count = 0
  for i in range(1,int(len(s)/2)):
    if s[point1-i]!=s[point2-i]:
      count += 1
  print(count)
# Judge status: Accepted
s = input()
k = int(input())
result = ""
i = 0
#a:97, z:122
while i < len(s)-1:
    s_i = ord(s[i])
    if s[i]=="a":
        result = result+"a"
    elif 123-s_i <= k:
        result = result+"a"
        k -= 123-s_i
    else:
        result = result+s[i]
    i += 1
if k>0:
    result = result + chr((ord(s[i])-97+k)%26+97)
else:
    result = result + s[i]

print(result)
# Judge status: Accepted
from collections import deque
n, m = map(int, input().split())
way = [[] for i in range(n + 1)]
ans = [-1 for i in range(n + 1)]
reached = [0 for i in range(n + 1)]

for i in range(m):
    a, b = map(int, input().split())
    way[a].append(b)
    way[b].append(a)
    
D = deque([1])
while D:
    go = D.popleft()
    for i in way[go]:
        if reached[i] == 0:
            D.append(i)
            reached[i] = 1
            ans[i] = go
print("Yes")
for i in range(2, n + 1):
    print(ans[i])
# Judge status: Accepted
N = int(input())
work = [list(map(int,input().split())) for _ in range(N)]
work.sort(key=lambda x:x[1])
Time = 0
ans = 'Yes'
for i in range(N):
  Time += work[i][0]
  if Time > work[i][1]:
    ans = 'No'
    break
print(ans)
# Judge status: Wrong Answer
A = list(map(int, input().split(" ")))
count=0
if A[0]==A[1]:
    count += 1
if A[0]==A[2]:
    count+=1
if A[1]==A[2]:
    count += 1

if count == 1:
    print("YES")
else:
    print("NO")
# Judge status: Accepted
a = int(input())

i = 0
while a >= 500:
    i = i+1
    a = a-500

j = 0
while a >= 5:
    j = j+1
    a = a-5

print(1000*i+5*j)
# Judge status: Accepted
# sys.stdin.readline()
import sys
input = sys.stdin.readline

N,K=map(int, input().split())
h=list(map(int, input().split()))
import numpy as np 
      
f_inf = float('inf')
dp = [f_inf]*N
dp[0]=0
# hの配列を作る。
h = np.array(h)
 
#配るDP
for i in range(1,N):
    # start は負になることはない。
    start = max(0, i-K)
    # 行列として足し算できるのでforを使う必要がない。
    dp[i] = min(dp[start: i] + np.abs(h[i] - h[start: i]))
    
print(dp[-1])
# Judge status: Accepted
N = list(map(int, list(input())))
x = (N[0])-1 + 9*(len(N)-1)
print(max(sum(N), x))
# Judge status: Wrong Answer
l,r,d=list(map(int,input().split()))
if l>r: l,r = r,l
k=(r-l+1)//d
x=(r-l+1)%d
if x:
    k+=-(l//d)+(l+x-1)//d
print(k)
# Judge status: Accepted
import collections
N,K = map(int, input().split())
A = list(map(int, input().split()))
C = collections.Counter(A)
B = C.most_common()[::-1]
l =  len(B)
ans = 0
for i in range(N):
  if l > K:
    ans += B[i][1]
    l -= 1
  else:
    break
print(ans)
# Judge status: Accepted
s = list(input())
t = input()
ans = "No"

for _ in range(len(s)):
    if "".join(s) == t:
        ans = "Yes"
        break
    else:
        last_s = s.pop(-1)
        s.insert(0, last_s)
print(ans)
# Judge status: Wrong Answer
N, X, Y = map(int, input().split())
d = Y-X
c = []
for i in range(1,N):
  for j in range(i+1,N+1):
    if i == X and j == Y:
      c.append(1)
    elif i <= X and j >= Y:
      c.append(j-i-d+1)
    else:
      c.append(j-i)
for i in range(1,N):
  ans = c.count(i)
  print(ans)
# Judge status: Accepted
A,B=map(int,input().split())
A=(A+13)%15
B=(B+13)%15

if A>B:
  print("Alice")
elif A<B:
  print("Bob")
else:
  print("Draw")
# Judge status: Accepted
N,K=map(int,input().split())
A=list(map(int,input().split()))
ans = 1
N -= K
while N>0:
  ans += 1
  N -= K-1
print(ans)
# Judge status: Accepted
# -*- coding: utf-8 -*-

N,M,X,Y = list(map(int, input().rstrip().split()))
x_list = list(map(int, input().rstrip().split())) + [X]
y_list = list(map(int, input().rstrip().split())) + [Y]
#-----

x_list.sort()
y_list.sort()

x_max = x_list[-1]
y_min = y_list[0]

print( "No War" if  (y_min - x_max) > 0 else "War")
# Judge status: Accepted
a = ["SUN","MON","TUE","WED","THU","FRI","SAT"]
s = input()

print(7-a.index(s))
# Judge status: Wrong Answer
AB,BC,CA = map(int,input().split())
print(AB*BC/2)
# Judge status: Accepted
d = int(input())
c = list(map(int,input().split()))
s = [list(map(int,input().split())) for i in range(365)]

for i in s:
    print(i.index(max(i))+1)
# Judge status: Wrong Answer
A, B, C, X, Y = map(int, input().split())

ans = min(A*X+B*Y, C*max(X, Y)*2, C*min(X,Y)*2+(max(X,Y)-min(X,Y))*A)

print(ans)
# Judge status: Wrong Answer
import collections
n = int(input())
s = [input() for _ in range(n)]
m = int(input())
t = [input() for _ in range(m)]

S = collections.Counter(s)
T = collections.Counter(t)


ans = [0]
for key, cont in S.most_common():
  if cont > T[key]:
    ans.append(cont)
print(max(ans))
# Judge status: Wrong Answer
N,M = map(int,input().split())
one = []
goal = []
for i in range(M):
    A,B = map(int,input().split())

    if A == 1: one.append(B)
    elif B == 1: one.append(A)
    
    if A == M: goal.append(B)
    elif B == M: goal.append(A)

if set(goal) & set(one):
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")
# Judge status: Accepted
def main():
    n, k = map(int, input().split())
    ans = 1 + (n - k) // (k - 1) + ((n - k) % (k - 1) != 0)
    print(ans)


if __name__ == '__main__':
    main()
# Judge status: Accepted
n = int(input())
print((n*800) - (n//15*200))
# Judge status: Accepted
# Python3 (3.4.3)
import sys
input = sys.stdin.readline

# -------------------------------------------------------------
# function
# -------------------------------------------------------------


# -------------------------------------------------------------
# main
# -------------------------------------------------------------
A,B = map(int,input().split())

d = B-A
H = d*(d+1)//2
print(H-B)
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))
dif = 0
sum = 0

for i in range(N - 1):
  if A[i] > A[i + 1]:
    dif = A[i] - A[i + 1]
    sum += dif
    A[i +1] = A[i + 1] + dif
    
print(sum)
# Judge status: Accepted
n, k = map(int, input().split())
ll = []
for i in range(n):
    a, b = map(int, input().split())
    ll.append([a, b])
lls = sorted(ll)
cnt = 0
for i in range(n):
    cnt += lls[i][1]
    if cnt  >= k:
        print(lls[i][0])
        break
# Judge status: Accepted
n,k = map(int,input().split())
p = list(map(int,input().split()))

ls_mu = []
for i in range(n):
    mu = (p[i]+1)/2
    ls_mu.append(mu)
# print(ls_mu)
m = 0
M = 0
for i in range(n-k+1):
    if i==0:
        for j in range(k):
            m += ls_mu[j]
        M += m
    else:
        l = ls_mu[i-1]
        r = ls_mu[i+k-1]
        m = m - l + r
        M = max(m,M)

print(M)
# Judge status: Accepted
x = int(input())
import math

def prime(n):
    if n == 1: return False
    for k in range(2, int(math.sqrt(n)) + 1):
        if n % k == 0:
            return 0
    return 1

while True:
  if(prime(x) == 1):
    print(x)
    exit()
  else:
    x = x+1
# Judge status: Wrong Answer
def main():
    x = int(input())

    q, r = divmod(x, 11)
    ans = q * 2 + (1 if r <= 6 else 2)
    print(ans)


if __name__ == '__main__':
    main()
# Judge status: Accepted
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

n, k = map(int, readline().split())
s = read().rstrip().decode()
ans = n - 1
for bf, af in zip(s, s[1:]):
    if bf != af:
        ans -= 1
print(min(n - 1, ans + k * 2))
# Judge status: Accepted
n,m=map(int,input().split())
if n==1 and m==1:
    print(1)
elif n==1 or m==1:
    print(max(n,m)-2)
else:
    print(n*m-(2*n+2*m-4))
# Judge status: Accepted
A,B=map(int,input().split())
if A<=8 and B<=8:
  print("Yay!")
else:
  print(":(")
# Judge status: Wrong Answer
n = int(input())
buses = [int(input())for i in range(5)]
buses.sort()
capa = (n//buses[0])
print(5+capa)
# Judge status: Wrong Answer
n, _ = map(int, input().split())
nums = list(map(int, input().split()))
total = sum(nums)
ans = n - total
print(ans)
# Judge status: Accepted
N,M = map(int,input().split())
#A = list(map(int,input().split()))
ans = max(0,N-2)*max(0,M-2)
if N == 2 or M == 2:
    print(0)
elif N == 1 or M == 1:
    print(max(1,max(N,M)-2))
else:
    print((N-2)*(M-2))
# Judge status: Accepted
N = int (input())
A = [int(a) for a in input().split()]
d = 0
ans = 1
for i in range(1, N):
    if A[i-1] < A[i]:
        if d < 0:
            ans += 1
            d = 0
        elif d == 0:
            d = 1

    elif A[i-1] > A [i]:
        if d > 0:
            ans +=1
            d = 0
        elif d == 0:
            d = -1

print(ans)
# Judge status: Accepted
from math import factorial
def comb(n,r):
    return (factorial(n) // (factorial(r) * factorial(n-r))) % (10**9 + 7)

N = int(input())

if N <= 2:
    print(0)
    exit()

m = 2
ans = 1

while 3*m <= N:
    ans += comb(N - 2*m - 1, m - 1) 
    ans %= (10**9 + 7)
    m += 1
print(ans)
# Judge status: Accepted
def myAnswer(N:int,s:str,t:str) -> int:
   if(s == t): return N
   if(N == 1): return 2
   total = N * 2
   # sとtを比較して重なった文字数をtotalから引く
   for i in range(N):
      if(s[i:] == t[:N-i]):
         total -= len(s[i:])
         break
   return total

def modelAnswer():
   return
def main():
   N = int(input())
   s = input()
   t = input()
   print(myAnswer(N,s,t))
if __name__ == '__main__':
   main()
# Judge status: Accepted
x = int(input())

cnt = 0
m = 100
while True:
    cnt += 1
    m = int(m * 1.01)
    if x <= m:
        print(cnt)
        break
# Judge status: Accepted
import bisect
def I(): return int(input())
def LI(): return list(map(int,input().split()))
N = I()
A = sorted(LI())
B = sorted(LI())
C = sorted(LI())
ans = 0
for b in B:
    ok_a = bisect.bisect_left(A,b)
    ok_c = bisect.bisect_right(C,b)
    ans += ok_a*(N-ok_c)
print(ans)
# Judge status: Accepted
N,K=map(int,input().split())
A=list(map(int,input().split()))
B=[0]*(N+1)
C=0
for i in range(K):
  for j in range(N+1):
    B[j]=0
  for j in range(N):
    B[max(0,j-A[j])]+=1
    B[min(N,j+A[j]+1)]-=1
  C=0
  for j in range(N):
    C+=B[j]
    A[j]=C
  if set(A)==set([N]):
    break
print(*A)
# Judge status: Accepted
# -*- coding: utf-8 -*-
from math import ceil
h = int(input())
w = int(input())
n = int(input())

print(ceil(n/max(h,w)))
# Judge status: Wrong Answer
N = int(input())
a = [0,0,0,1,1,1,2,3,4,6,9]
s = 0
for nums in a:
  s += nums
if N <= 10:
  print(a[N])
else:
  while len(a)<=N:
    a.append(1+s-a[-1]-a[-2])
    s += a[-1]
    p = 10**9+7
    print(a[-1]%p)
# Judge status: Accepted
import sys
# input処理を高速化する
input = lambda: sys.stdin.readline().rstrip()

N = int(input())
expo = set()
for i in range(1, 32):
    for j in range(2, 10):
        if i ** j > 1000:
            break
        expo.add(i ** j)
expo = sorted(list(expo), reverse=True)
for e in expo:
    if e <= N:
        print(e)
        exit()
# Judge status: Accepted
s = input()

i = len(s)

while i > 0:
    if s[i-5:i] == 'dream':
        i -= 5
        continue
    elif s[i - 7:i] == 'dreamer':
        i -= 7
        continue
    elif s[i-5: i] == 'erase':
        i -= 5
        continue
    elif s[i-6: i] == 'eraser':
        i -= 6
        continue
    else:
        print('NO')
        exit(0)

print('YES')
# Judge status: Wrong Answer
input = open(0).readline
s = {}
s['A'] = list(input().strip())
s['B'] = list(input().strip())
s['C'] = list(input().strip())

play_order = {'A', 'B', 'C'}

def play(player):
    
    if  s[player] == []:
        play(next_play.upper())
    
    next_play = s[player].pop()
    if s[player] == []:
        print(player)
        return player
    #print(next_play)
    play(next_play.upper())
        
play('A')
# Judge status: Accepted
n = int(input())
p = list(map(int, input().split()))
c = 0
for i in range(0, n):
    if p[i] != i + 1:
        c += 1
print("YES" if c <= 2 else "NO")
# Judge status: Accepted
from functools import reduce
from fractions import gcd
N,X = map(int,input().split())
W = list(map(int,input().split())) + [X]
W = sorted(W)
sa_w = [W[i+1] - W[i] for i in range(N)]
ans = reduce(gcd, sa_w)
print(ans)
# Judge status: Accepted
N=int(input())
S=input()
c=[0]
d=0
for i in range(N):
  if S[i]=='I':
    d+=1
    c.append(d)
    
  else:
    d-=1
    c.append(d)
    
print(max(c))
# Judge status: Accepted
s = list(str(input()))
s.reverse()
S = []

c = ''
for i in range(len(s)):
    c += s[i]
    if S:
        if c != S[-1]:
            S.append(c)
            c = ''
    else:
        S.append(c)
        c = ''
#print(S)
print(len(S))