Harryxun/stf_run huggingface dataset:
from scipy.special import comb
import time

N = input()
K = int(input())

N_len = len(N)

ans = 0
if K == 1:
    time.sleep(0.3)
    ans = int(N[0]) + 9 * (N_len-1)
elif K == 2:
    time.sleep(0.6)
    if N_len >= 2:
        ans = (int(N[0])-1) * 9 *(N_len-1)
        ans += int(N[1]) + 9 * (N_len-2)
        for i in range(1,N_len-1):
            ans += 9*9*i
elif K == 3:
    time.sleep(0.9)
    if N_len >= 3:
        # N[0],N[1]
        ans = int(N[2]) + 9 * (N_len-3)
        # N[0], 1~N[1]-1
        ans += max(int(N[1])-1,0) * 9 * (N_len-2)
        # N[0], N[1] = 0
        ans += 9**2 * comb(N_len-2,2,exact=True)
        # 1~N[0]-1
        ans += (int(N[0])-1) * 9**2 * comb(N_len-1,2,exact=True)     
        # N[0] = 0
        for i in range(2,N_len-1):
            ans += 9**3 * comb(i,2,exact=True)


#print(9**3*comb(N_len,3,exact=True))
print(ans)

### FIXED CODE ###

import numpy as np

dp = np.zeros((105,4,2),dtype=np.int32)

s = input()
n = len(s)
K = int(input())

dp[0][0][0] = 1
for i in range(n):
    for j in range(4):
        for k in range(2):
            nd = int(s[i])
            for d in range(10):
                ni = i + 1
                nj = j 
                nk = k
                if d != 0:
                    nj += 1
                if nj > K:
                    continue
                if k == 0:
                    if d > nd:
                        continue
                    if d < nd:
                        nk = 1
                dp[ni][nj][nk] += dp[i][j][k]
ans = dp[n][K][0] + dp[n][K][1]
print(ans)
n = int(input())
if n[1] == n[2] and n[0] == [1] or n[1] == n[2] and n[2] == n[3]:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

n = (input())
if n[0] == n[1] == n[2] or n[1] == n[2] == n[3]:
    print('Yes')
else:
    print('No')
# https://atcoder.jp/contests/abc088/tasks/abc088_d
from collections import deque

H, W = map(int, input().split())
s = [input() for _ in range(H)]
d = [[-1] * W for _ in range(W)]

# 0,0 to h-1, w-1
d[0][0] = 0

queue = deque()
queue.append([0, 0])

while len(queue) > 0:
    p = queue.popleft()
    y, x = p[0], p[1]

    dx4 = [0, 0, 1, -1]
    dy4 = [1, -1, 0, 0]

    for dx, dy in zip(dx4, dy4):
        next_y = y + dy
        next_x = x + dx
        if 0 <= next_y < H and 0 <= next_x < W and s[next_y][next_x] != "#" and d[next_y][next_x] == -1:
            d[next_y][next_x] = d[y][x] + 1
            queue.append([next_y, next_x])

count = 0
for l in s:
    count += l.count(".")

if d[H-1][W-1] == -1:
    print(-1)
else:
    print(count - d[H-1][W-1] - 1)

# [print(l) for l in s]
# [print(l) for l in d]


### FIXED CODE ###

from queue import Queue

inf = 10 ** 20

def bfs(H, W, s):
    d = [[inf for i in range(W)] for j in range(H)]
    q = Queue()

    d[0][0] = 1
    q.put([0, 0])

    dx = (0, -1, 1, 0)
    dy = (-1, 0, 0, 1)

    while not q.empty():
        p = q.get()
        x = p[0]
        y = p[1]
        for i in range(4):
            nx = x + dx[i]
            ny = y + dy[i]
            if(nx >= 0 and nx < H and ny >= 0 and ny < W):
                if(s[nx][ny] == '.' and d[x][y] + 1 < d[nx][ny]):
                    d[nx][ny] = d[x][y] + 1
                    q.put([nx, ny])

    return d[H-1][W-1]

H, W = map(int, input().split())
s = []
wnum = 0
for i in range(H):
    s.append(input())
    for j in range(W):
        if(s[i][j] == "."):
            wnum += 1
d = bfs(H, W, s)
if(d == inf):
    print("-1")
else:
    print(wnum - d)
x,y = list(map(int,input().split()))

mod = 10**9 + 7

# import math
# def comb(n,r):
#     return (math.factorial(n)//(math.factorial(n-r)*math.factorial(r)))

# def comb(n, r, mod):
#     if ( r<0 or r>n ):
#         return 0
#     r = min(r, n-r)
#     return g1[n] * g2[r] * g2[n-r] % mod

def comb_mod(n, r, mod):
    if n < r:
        return 0
    elif n < 0 or r < 0:
        return 0
    else:
        fac = [1, 1]
        finv = [1, 1]
        inv = [0, 1]
        for i in range(2, n + 1):
            fac.append(fac[-1] * i % mod)
            inv.append(-inv[mod % i] * (mod // i) % mod)
            finv.append((finv[-1] * inv[-1]) % mod)
        return int(fac[n] * finv[r] * finv[n - r] % mod)


# def comb(n,r,mod):
# 	'''
# 	return nCr
# 	O(min{n-r, r})
# 	'''
# 	a=1
# 	b=1
# 	r = min(r,n-r)
# 	for i in range(r):
# 		a = a*(n-i)%mod
# 		b = b*(i+1)%mod
# 	return a*pow(b,mod-2,mod)%mod

if (x+y)%3!=0:
    print(0)
    exit()
else:
    n = int((2/3)*x - (1/3)*y)
    m = int((2/3)*y - (1/3)*x)
    if n>=0 and m>=0:
        print(comb(n+m,m,mod))
        exit()
    else:
        print(0)
        exit()

### FIXED CODE ###

x,y = list(map(int,input().split()))

mod = 10**9 + 7

# import math
# def comb(n,r):
#     return (math.factorial(n)//(math.factorial(n-r)*math.factorial(r)))

# def comb(n, r, mod):
#     if ( r<0 or r>n ):
#         return 0
#     r = min(r, n-r)
#     return g1[n] * g2[r] * g2[n-r] % mod

def comb_mod(n, r, mod):
    if n < r:
        return 0
    elif n < 0 or r < 0:
        return 0
    else:
        fac = [1, 1]
        finv = [1, 1]
        inv = [0, 1]
        for i in range(2, n + 1):
            fac.append(fac[-1] * i % mod)
            inv.append(-inv[mod % i] * (mod // i) % mod)
            finv.append((finv[-1] * inv[-1]) % mod)
        return int(fac[n] * finv[r] * finv[n - r] % mod)


# def comb(n,r,mod):
# 	'''
# 	return nCr
# 	O(min{n-r, r})
# 	'''
# 	a=1
# 	b=1
# 	r = min(r,n-r)
# 	for i in range(r):
# 		a = a*(n-i)%mod
# 		b = b*(i+1)%mod
# 	return a*pow(b,mod-2,mod)%mod

if (x+y)%3!=0:
    print(0)
    exit()
else:
    m = int((2*x - y)/3)
    n = int((2*y - x)/3)
    if n>=0 and m>=0:
        print(comb_mod(n+m,n,mod))
        exit()
    else:
        print(0)
        exit()
[H, W] = raw_input().split(' ')
for i in range(H):
    for index, string in enumerate(raw_input.split(' ')):
        if string == 'snuke':
            print i, index

### FIXED CODE ###

[H, W] = raw_input().split(' ')
for i in range(int(H)):
    for index, string in enumerate(raw_input().split(' ')):
        if string == 'snuke':
            print '%s%s' % (str(unichr(index + 65)), (i+1))
            exit()
def solve(S):
    N = len(S)
    if N == 2:
        if S[0] == S[1]: # oxx
            return 1,2
    for i in range(N-2):
        if S[i] ==  S[i+1]:  # xxo
            return i+1,i+2
        if S[i+1] == S[i+2]: # oxx
            return i+2,i+3
        if S[i] == S[i+2]:   # xox
            return i+1,i+3
    return -1, -1
def solv(s)print(*solve(input()))


### FIXED CODE ###

def solve(S):
    N = len(S)
    # N <= 10**5
    if N == 2:
        if S[0] == S[1]:
            return 1, 2
    for i in range(0, N-2):
        if S[i] == S[i+2]:
            return i+1, i+3
        if S[i] == S[i+1]:
            return i+1, i+3
        if S[i+1] == S[i+2]:
            return i+1, i+3
    return -1, -1
S = input()
print(*solve(S))
import itertools
S=input()
T=input()

def insert_hint(item,hintindex,S):
  for i in hintindex:
    item.insert(i,S[i])
  return item
  
hintindex=[n for _,n in enumerate(range(len(S))) if S[n]!="?"]

zenbu=list(itertools.permutations(
  list("abcdefghijklmnopqrstuvwxyz"),
  len(S)-len(hintindex)
))
zenbu=[insert_hint(list(item),hintindex,S) for item in zenbu]
#print(zenbu[-1])

anslist=[item for item in zenbu if "".join(item).find(T)!=-1]

print(anslist)
print("".join(sorted(anslist)[0]))

### FIXED CODE ###

import re
S = input().replace('?', '.')
T = input()
for i in range(len(S)-len(T), -1, -1):
    if re.match(S[i:i+len(T)], T):
        S = S.replace('.', 'a')
        print(S[:i]+T+S[i+len(T):])
        exit()
print('UNRESTORABLE')
import numpy as np
from collections import defaultdict
from functools import reduce

import bisect

# s = input()
Q = int(input())
# A = list(map(int, input().split()))
# n, m, k = map(int, input().split())


As = []
A_left = 0
A_right = 0

b_sum = 0

# n = len(As)
# n is odd:
# A_left + As[n//2] + B_left
# n is even:
# A_left + B_left

for i in range(Q):
    query = list(map(int, input().split()))

    if query[0] == 1:
      a =  query[1]
      n = len(As)
      if n == 0:
        As.append(a)
      else:
        idx = bisect.bisect_left(As, a)
        if n%2 == 0: # even
          if idx < n//2:
            A_left += a
            A_left -= As[n//2-1]
          elif idx > n//2:
            A_right += a
            A_right -= As[n//2]
        else: # odd
          if idx <= n//2:
            A_left += a
            A_right += As[n//2]
          else:
            A_right += a
            A_left += As[n//2]
        bisect.insort_left(As, a)

      # print(As)
      # print(A_left)
      # print(A_right)

      b_sum += query[2]
    else:
      n = len(As)
      if n%2 == 0: #even
        print(As[n//2-1], A_right - A_left + b_sum)
      else:
        print(As[n//2], A_right - A_left + b_sum)


### FIXED CODE ###

# import numpy as np
# from collections import defaultdict
# from functools import reduce

import heapq

# s = input()
Q = int(input())
# A = list(map(int, input().split()))
# n, m, k = map(int, input().split())


A_left_sum = 0
A_left = []
A_right_sum = 0
A_right = []
A_med = None
query_size = 0
b_sum = 0

# n = len(As)
# n is odd:
# A_left + As[n//2] + B_left
# n is even:
# A_left + B_left

for i in range(Q):
    query = list(map(int, input().split()))

    if query[0] == 1:
      a =  query[1]
      if A_med is None:
        A_med = a
      else:
        if query_size%2 == 0: # even
          left_max = -A_left[0]
          right_min = A_right[0]
          if a < left_max:
            heapq.heappushpop(A_left, -a)
            A_left_sum += a - left_max
            A_med = left_max
          elif a > right_min:
            heapq.heappushpop(A_right, a)
            A_right_sum += a - right_min
            A_med = right_min
          else:
            A_med = a
        else: # odd
          if A_med <= a:
            heapq.heappush(A_left, -A_med)
            heapq.heappush(A_right, a)
            A_left_sum += A_med
            A_right_sum += a
          else:
            heapq.heappush(A_left, -a)
            heapq.heappush(A_right, A_med)
            A_right_sum += A_med
            A_left_sum += a

      # print(As)
      # print(A_left)
      # print(A_right)
      query_size += 1

      b_sum += query[2]
    else:
      if query_size%2 == 0: #even
        print(-A_left[0], A_right_sum - A_left_sum + b_sum)
      else:
        print(A_med, A_right_sum - A_left_sum + b_sum)
import sys

def func(array, arr, d):
  for v in arr:
    if array[v[0]] == None:
      d1 = d + v[1]
      array[v[0]] = d1
      arr1 = dic.get(v[0], [])
      
      if not func(array, arr1, d1):
        return False
      
    elif array[v[0]] != d + v[1]:
      return False
    
  return True
      

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

array = [None] * n
dic = {}

for i in range(m):
  l,r,d = map(int, input().split())
  l -= 1
  r -= 1
  
  dic.setdefault(l,[])
  dic.setdefault(r,[])
  dic[l].append((r,d))
  dic[r].append((l,-d))
  
for i in range(n):
  if array[i] != None:
    continue
    
  array[i] = 0
  arr = dic.get(i, [])
  
  if not func(array, arr, 0):
    print('No')
    sys.exit()

print('Yes')    

### FIXED CODE ###

import sys

sys.setrecursionlimit(4100000)

def func(array, arr, d):
  for v in arr:
    if array[v[0]] == None:
      d1 = d + v[1]
      array[v[0]] = d1
      arr1 = dic.get(v[0], [])
      
      if not func(array, arr1, d1):
        return False
      
    elif array[v[0]] != d + v[1]:
      return False
    
  return True
      

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

array = [None] * n
dic = {}

for i in range(m):
  l,r,d = map(int, input().split())
  l -= 1
  r -= 1
  
  dic.setdefault(l,[])
  dic.setdefault(r,[])
  dic[l].append((r,d))
  dic[r].append((l,-d))
  
for i in range(n):
  if array[i] != None:
    continue
    
  array[i] = 0
  arr = dic.get(i, [])
  
  if not func(array, arr, 0):
    print('No')
    sys.exit()

print('Yes')
s = input()

if s = "BBB" or s = "AAA": print("No")
else: print("Yes")

### FIXED CODE ###

s = input()

if s == "BBB" or s == "AAA": print("No")
else: print("Yes")
S = input()
T = input()
T = map(int,imput().split())
cnt = 0
for x,y in  S,T:
	if x!=y:
		cnt += 1

print(cnt)

### FIXED CODE ###

S = input()
T = input()
slen = len(S)

cnt = 0
for i in  range(0,slen):
	if S[i] !=T[i]:
		cnt += 1

print(cnt)
import math
x,y = input().split()
a = int(x)
b = int(y)
print(int((a*b)/math.gcd(a,b)))

### FIXED CODE ###


x, y = input().split()
x = int(x)
y = int(y)
if x < y:
    a = y
    b = x
else:
    a = x
    b = y

while b:
    a, b = b, a % b

print(x * y // a)
def main():
	H = int(input())
	cnt = 0
	while 1:
		if H==1:
			break
		else:
			H = H//2
			cnt += 1
	ans = 0
	for i in range(cnt):
		ans += 2**i
	ans += 2**(i+1)
	print(ans)

if __name__ == '__main__':
	main()

### FIXED CODE ###

def main():
	H = int(input())
	cnt = 0
	if H==1:
		print(1)
		exit()
	while 1:
		if H==1:
			break
		else:
			H = H//2
			cnt += 1
	ans = 0
	for i in range(cnt):
		ans += 2**i
	ans += 2**(i+1)
	print(ans)

if __name__ == '__main__':
	main()
n = int(input())
s,t = input().split()

for i in range(n):
    u = u + s[i] + t[i]

print(u)


### FIXED CODE ###

a = int(input())
b = int(input())

print(6-a-b)
a,b,k = map(int,input().split())
tmp = list(range(a,b+1))
if b-a+1 >= k:
	ans = tmp[:k] + tmp[-k:]
else:
	ans = tmp
for i in set(ans):
	print(i)

### FIXED CODE ###

a,b,k=map(int,input().split())
if a+k-1>=b-k+1:
    for i in range(a,b+1):
        print(i)
else:
    for i in range(a,a+k):
        print(i)
    for i in range(b-k+1,b+1):
        print(i)
a,b = map(str,input().split())
if a == D and b == D:
    print('H')
elif a == H and b == H:
    print('H')
else:
    print('D')

### FIXED CODE ###

a,b = map(str,input().split())
if a == 'D' and b == 'D':
    print('H')
elif a == 'H' and b == 'H':
    print('H')
else:
    print('D')
#ALDS1_4-D Allocation
from collections import deque

def pIsAccptbl(w,k,p):
    tr = 0
    c = 0
    while(w):
        tmp = w.popleft()
        if( tr + tmp > p):
            tr = tmp
            c += 1
        else:
            tr += tmp

    c+=1
    if c>k:
        return False
    else:
        return True
    
n,k = input().split()
w = deque()

for i in range(int(n)):
    w.append(int(input()))

p = max(w)

while(1):
    x=deque()
    x=w.copy()
    
    if(pIsAccptbl(x,int(k),p)):
        print(p)
        break
    else:
        p+=1

### FIXED CODE ###

from collections import deque

def isPa(w,k,p):
    tr = 0
    c = 0
    d = deque(w)
    while(d):
        tmp = d.popleft()
        if(tmp > p):
            return False
        
        if( tr + tmp > p):
            tr = tmp
            c += 1
        else:
            tr += tmp
        if c+1>k:
            return False
    return True

def MaxInP(w,k,p):
    maxinp = 0
    tmp = 0
    d = deque(w)
    while(d):
        tmp += d.popleft();
        if(tmp > p):
            if(tmp > maxinp):
                maxinp = tmp
            tmp = 0
    return maxinp

n,k = [int(x) for x in input().split()]
w = deque()
for i in range(n):
    w.append(int(input()))
    
mean = int(sum(w)/k)
maxinp = MaxInP(w,k,mean)

if k == 1:
    print(mean)
else:
    minP = mean
    maxP = maxinp
    while(True):
        m = int ((minP + maxP)/2)
        if ( isPa(w,k,m) ):
            maxP = m
        else:
            minP = m
        if (minP+1 == maxP or minP == maxP):
            print(maxP)
            break
import sys
import math
K, A, B = list(map(int, input().split()))

if (A >= K):
    print('1')
    sys.exit()
elif (A - B) <= 0:
    print('-1')
    sys.exit()
d = A-B
p = K-A
q = int(p//d)
if ((p % d) != 0):
    q += 1
print(str(2*q + 1))

### FIXED CODE ###

import sys
import math
K, A, B = list(map(int, input().split()))
 
if (A >= K):
    print('1')
    sys.exit()
elif (A - B) <= 0:
    print('-1')
    sys.exit()
d = A-B
p = K-A
q = int(p//d)
if ((p % d) != 0):
    q += 1
print(str(2*q + 1))
s = [_ for _ in input()]
s_s = list(set(s))

if len(s_s) >= 3:
  print("No")
else:
  if s.count(s_s[0]) == s.count(s_s[1]):
    print("Yes")
  else:
    print("No")

### FIXED CODE ###

s = input()
s_s = list(set(s))

if len(s_s) == 2:
  if s.count(s_s[0]) == s.count(s_s[1]):
    print("Yes")
else:
    print('No')
a,b = map(int,input().split())

if a == b:
    print(a)
    exit()
ansl = []
if a % 2 == 1:
    ansl.append(a)
    a += 1
if b % 2 == 0:
    ansl.append(b)
    b -= 1

k = b - a + 1
k = k // 2
if k % 2 == 1:
    ansl.append(1)

if len(ansl) == 1:
    print(ansl[0])
elif len(ansl) == 2:
    print(ansl[0] ^ ansl[1])
else:
    print(ansl[0] ^ ansl[1] ^ ansl[2])

### FIXED CODE ###

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

a1 = 0
b1 = 0
l = []
if a % 2 != 0:
   a1 = 1
if b % 2 == 0:
   b1 = 1
if a1 == 1:
   l.append(a)
one = b - a + 1 - a1 -b1
if one // 2 % 2 == 0:
   l.append(0)
if one // 2 % 2 == 1:
   l.append(1)
if b1 == 1:
   l.append(b)

if len(l) == 1:
   print(l[0])
if len(l) == 2:
   print(l[0]^l[1])
if len(l) == 3:
   print(l[0]^l[1]^l[2])
import math
X,Y=map(int, input().split())
if (X+Y)%3!=0:
  print(0)
  exit()
n=(X+Y)//3
for i in range(n+1):
  if 2*i +(n-i) == X:
    right=i
    up=n-i
    break
  elif 2*(n-i)+i == X:
    up=i
    right=n-i
    break

def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod

mod = 10**9+7 #出力の制限
g1 = [1, 1] # 元テーブル
g2 = [1, 1] #逆元テーブル
inverse = [0, 1] #逆元テーブル計算用テーブル

for i in range( 2, n + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )

a = cmb(n,right,mod)
print(a)

### FIXED CODE ###

X,Y=map(int, input().split())
if (X+Y)%3!=0:
  print(0)
  exit()
n=(X+Y)//3
flg=True
for i in range(n+1):
  if 2*i +(n-i) == X:
    right=i
    up=n-i
    flg=False
    break
  elif 2*(n-i)+i == X:
    up=i
    right=n-i
    flg=False
    break
if flg:
  print(0)
  exit()
  

def cmb(n, r, mod):
    if r<0 or r>n :
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod

mod = 10**9+7 #出力の制限
g1 = [1, 1] # 元テーブル
g2 = [1, 1] #逆元テーブル
inverse = [0, 1] #逆元テーブル計算用テーブル

for i in range( 2, n + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )

a = cmb(n,right,mod)
print(a)
import sys
input = sys.stdin.buffer.readline

n, m, q = map(int, input().split())

class TwoDimSum():
    def __init__(self, h, w):
        self.counts = [[0 for _ in range(w+1)] for _ in range(h+1)]
        self.s = [[0 for _ in range(w+1)] for _ in range(h+1)]

    def add_count(self, x, y):
        # 0-indexed
        self.counts[y+1][x+1] += 1

    def build(self):
        for i in range(h):
            for j in range(w):
                self.s[i+1][j+1] = self.s[i][j+1] + self.s[i+1][j] - self.s[i][j] + self.counts[i][j]

    def solve(self, x1, y1, x2, y2):
        return self.s[x2][y2] - self.s[x1][y2] - s[x2][y1] + s[x1][y1]

counts = TwoDimSum()
for _ in range(m):
    l, r = map(int, input().split())
    counts.add_count(l-1, r-1)
counts.build()

for i in range(q):
    x, y = map(int, input().split())
    ans.append(str(counts.solve(x, x, y, y)))
print("\n".join(ans))

### FIXED CODE ###

import sys
input = sys.stdin.buffer.readline

n, m, q = map(int, input().split())

counts = [[0 for _ in range(n+1)] for _ in range(n+1)]
for _ in range(m):
    l, r = map(int, input().split())
    counts[l][r] += 1

s = [[0 for _ in range(n+1)] for _ in range(n+1)]
# 横方向
for i in range(n+1):
    v = 0
    for j in range(n+1):
        v += counts[i][j]
        s[i][j] = v
# 縦方向
cs = [[0 for _ in range(n+1)] for _ in range(n+1)]
for i in range(n+1):
    v = 0
    for j in range(n+1):
        v += s[j][i]
        cs[j][i] = v


ans = []
for i in range(q):
    p, q = map(int, input().split())
    t = 0
    for i in range(p, q+1):
        t += s[i][q] - s[i][p-1]
    ans.append(str(t))
print("\n".join(ans))
n = int(input()

total = 0

for i in range(n+1):
    total += i

print(total)

### FIXED CODE ###

n = int(input())
counter = 1
number = 0
for i in range(1,n+1):
    number += counter
    counter += 1

print(number)
a = 2
b = 1
c = 0
for i in range(2, n + 1):
    c = a + b
    a = b
    b = c
print(c)

### FIXED CODE ###

n = int(input())

a, b = 2, 1
for i in range(n):
    a, b = b, a + b
print(a)
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import sys

input = sys.stdin.readline

cnt = 0

def main():
    N, X = map(int, input().split())
    L = [int(e) for e in input().split()]

    def rec(i, d):
        global cnt
        if d > X:
            return
        cnt += 1
        return rec(i+1, d + L[i])

    rec(0, 0)
    print(cnt)


main()


### FIXED CODE ###

#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import sys

input = sys.stdin.readline

cnt = 0

def main():
    N, X = map(int, input().split())
    L = [int(e) for e in input().split()]

    def rec(i, d):
        global cnt
        if d > X:
            return
        cnt += 1
        if i >= N:
            return
        return rec(i+1, d + L[i])

    rec(0, 0)
    print(cnt)


main()
import scipy.misc as sm

def fib(N):
  N = N-1
  a = N // 2
  ans = 0
  for i in range(a+1):
      sum = sm.factorial(N-i)/(sm.factorial(N-2*i)*sm.factorial(i))
      ans += int(sum)
  return ans

N, M = map(int, input().split())
A = []
for i in range(M):
  A.append(int(input()))

flag = False
for i in range(M-1):
  if (A[i]+1 == A[i+1]):
    flag = True

if flag:
  print(0)
else:
  parts = []  
  for i in range(M):
    if i == 0:
      a_list = [x for x in range(0, A[i])]
      parts.append(a_list)
    else:
      a_list = [x for x in range(A[i-1]+1, A[i])]
      parts.append(a_list)
  a_list = [x for x in range(A[M-1]+1, N+1)]
  parts.append(a_list)
  ans = 1
  for part in parts:
    part_ans = fib(len(part))
    ans *= part_ans
  print(ans % 1000000007)

    

### FIXED CODE ###

def fib(n):
    if n <= 1:
        return n
    result = [1, 0, 0, 1]
    matrix = [1, 1, 1, 0]
    while n > 0:
        if n % 2:
            result = mul(matrix, result)
        matrix = mul(matrix, matrix)
        n //= 2
    return result[2]

def mul(a, b):
    return [a[0]*b[0] + a[1]*b[2],
            a[0]*b[1] + a[1]*b[3],
            a[2]*b[0] + a[3]*b[2],
            a[2]*b[1] + a[3]*b[3]]

N, M = map(int, input().split())
A = []
for i in range(M):
  A.append(int(input()))

flag = False
for i in range(M-1):
  if (A[i]+1 == A[i+1]):
    flag = True

if flag:
  print(0)
elif M != 0:
  parts = []  
  for i in range(M):
    if i == 0:
      a_list = [x for x in range(0, A[i])]
      parts.append(a_list)
    else:
      a_list = [x for x in range(A[i-1]+1, A[i])]
      parts.append(a_list)
  a_list = [x for x in range(A[M-1]+1, N+1)]
  parts.append(a_list)
  ans = 1
  for part in parts:
    part_ans = fib(len(part))
    ans *= part_ans
  print(ans % 1000000007)
else:
  ans = fib(N+1)
  print(ans % 1000000007)
A,B = map(int,input().split())
if A == B:
  print(2A)
else:
  print(2*max(A,B))
  

### FIXED CODE ###

A,B = map(int,input().split())
if A == B:
  print(2*A)
else:
  print(max(2*A-1,2*B-1))