Harryxun/stf_run huggingface dataset:
a, p = map(int, input().suplit())

kakera = 3 * a + p
pie = kakera // 2
print(pie)

### FIXED CODE ###

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

kakera = 3 * a + p
pie = kakera // 2
print(pie)
n, q = map(int, input().split())

adj_list = [[] for _ in range(n + 1)]

for i in range(n - 1):
    u, v = map(int, input().split())
    adj_list[u].append(v)
    adj_list[v].append(u)

val = [0] * (n + 1)
visited = [False] * (n + 1)

for i in range(q):
    p, x = map(int, input().split())
    val[p] += x


def dfs(val, adj_list, visited, cur, prev):
    if prev != -1:
        val[cur] += val[prev]

    visited[cur] = True

    for next in adj_list[cur]:
        if visited[next] is False:
            dfs(val, adj_list, visited, next, cur)


dfs(val, adj_list, visited, 1, -1)

for i in range(n):
    print(val[i + 1], end="")
    if i != n - 1:
        print(" ", end="")
    else:
        print()


### FIXED CODE ###

from collections import deque

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

adj_list = [[] for _ in range(n + 1)]
val = [0] * (n + 1)
visited = [False] * (n + 1)

for i in range(n - 1):
    u, v = map(int, input().split())
    adj_list[u].append(v)
    adj_list[v].append(u)

for i in range(q):
    p, x = map(int, input().split())
    val[p] += x

dq = deque()
prev = -1
cur = 1
dq.append([cur, prev])

while len(dq) > 0:

    cur, prev = dq.popleft()
    if prev != -1:
        val[cur] += val[prev]
    visited[cur] = True

    for next in adj_list[cur]:
        if visited[next] is False:
            dq.append([next, cur])

print(*val[1:])
N=int(input())
P=list(map(int, input().split()))



mini=1
count=1
index_min=P.index(mini)
for i in range(N):
  P=P[:index_min]
  mini=min(P)
  index_min=P.index(mini)
  count+=1
  if mini==P[0]:
    break
  
"""
count=1
for i in range(1,N):
  if min(P[:i+1])==P[i]:
    count+=1
"""
print(count)



### FIXED CODE ###

n=int(input())
p=list(map(int, input().split()))
ans=1
l=[p[0]]
buf=p[0]
for i in range(1,n):
    l.append(p[i])
    if p[i]<=buf:
        ans+=1
        buf=p[i]
print(ans)
n = int(input())
a = [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[n+1])

### FIXED CODE ###

n = int(input())
a = [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[n-1])
a = int(a)
x = a + a**2 + a**3
print(x)

### FIXED CODE ###

a = int(input())
x = a + a**2 + a**3
print(x)
import sys
from collections import deque
input = sys.stdin.readline

N=int(input())
S=input().strip()+"E"

mod=998244353


S2=deque()
NOW=1
C=S[0]
for i in range(1,3*N+1):
    if S[i]==C:
        NOW+=1
    else:
        S2.append([C,NOW])
        NOW=1
        C=S[i]

LEN=len(S2)

ANS=1
for i in range(1,N+1):
    ANS=ANS*i%mod

NOW=[]
for i in range(3):
    x,y=S2.popleft()
    NOW.append([x,y])

#print(NOW)
while S2 or NOW:
    if len(S2)>0 and NOW[-1][0]==S2[0][0]:
        x,y=S2.popleft()
        NOW[-1][1]+=y

    while len(NOW)<=2:
        x,y=S2.popleft()
        NOW.append([x,y])

    ANS=ANS*NOW[0][1]*min(NOW[1][1],NOW[0][1])%mod
    NOW[0][1]-=1
    NOW[1][1]-=1
    NOW[2][1]-=1

    while len(NOW)>=3 and NOW[2][1]==0:
        NOW.pop(2)

    while len(NOW)>=2 and NOW[1][1]==0:
        NOW.pop(1)

    while len(NOW)>=1 and NOW[0][1]==0:
        NOW.pop(0)

    #print(NOW)
        
print(ANS)
    


### FIXED CODE ###

import sys
input = sys.stdin.readline

N=int(input())
S=input().strip()

mod=998244353

NOW=dict()
NOW["R"]=0
NOW["G"]=0
NOW["B"]=0

ANS=1
for i in range(1,N+1):
    ANS=ANS*i%mod

for s in S:
    k,l,m=sorted((NOW["R"],NOW["G"],NOW["B"]))
    
    if NOW[s]==m:
        NOW[s]+=1

    elif NOW[s]==l:
        NOW[s]+=1
        ANS=ANS*(m-l)%mod

    else:
        NOW[s]+=1
        ANS=ANS*l%mod
    
    if NOW["R"]>=1 and NOW["G"]>=1 and NOW["B"]>=1:
        NOW["R"]-=1
        NOW["G"]-=1
        NOW["B"]-=1

print(ANS)
a,b = map(int, inpur().split())

if a+b < 10:
  print(a+b)
else :
  print("error")

### FIXED CODE ###

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

if a+b < 10:
  print(a+b)
else :
  print("error")
class UnionFindTree():
    def __init__(self, num_leaves):
        #self.num_leaves = num_leaves
        self.root = [i for i in range(num_leaves+1)]
        
    def find(self, leaf):
        if self.root[leaf] == leaf:
            return self.root[leaf]
        else:
            self.root[leaf] = self.find(self.root[leaf])
            return self.root[leaf]
        
    def union(self, leaf_a, leaf_b):
      	# find roots
        root_a = self.find(leaf_a)
        root_b = self.find(leaf_b)
        if root_a != root_b:
            # then union roots
            self.root[leaf_b] = root_a
            
        
N, M = map(int, input().split())
uft = UnionFindTree(N)
for m in range(M):
  a, b = map(int, input().split())
  uft.union(a, b)
  
# 経路圧縮
for n in range(N):
  uft.find(n)
  
max_size = [uft.root.count(n) for n in range(N)].max()
print(num_group)

### FIXED CODE ###

class UnionFindTree():
    def __init__(self, n):
        self.parents = [-1] * n

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

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

        if x == y:
            return
        
        # 常にxの要素数＞yの要素数とする
        if self.parents[x] > self.parents[y]:
            x, y = y, x
            
        # self.parents[x] に　yの要素数を追加してから併合
        self.parents[x] += self.parents[y]
        self.parents[y] = x
  
N, M = map(int, input().split())
uft = UnionFindTree(N)
for m in range(M):
  a, b = map(lambda x: int(x)-1, input().split())
  uft.union(a, b)
  
print(-min(uft.parents))
from heapq import heappush, heappop
n = int(input())
adj = [[] for _ in range(n)]
for _ in range(n-1):
	a, b = map(int, input().split())
	adj[a-1].append(b-1)
	adj[b-1].append(a-1)
num = [0 for _ in range(n)]
c = list(map(int, input().split()))
h = []
for i in range(n):
	heappush(h, -c[i])

def dfs(x, par):
	global h
	for v in adj[x]:
		if num[v] != 0:
			continue
		num[v] = -heappop(h)
		dfs(v, x)
	return

num[0] = -heappop(h)
dfs(0, -1)
print(sum(c) - max(c))
print(*num)

### FIXED CODE ###

import sys
from heapq import heappush, heappop
sys.setrecursionlimit(10**6)

n = int(input())
adj = [[] for _ in range(n)]
for _ in range(n-1):
	a, b = map(int, input().split())
	adj[a-1].append(b-1)
	adj[b-1].append(a-1)
num = [0 for _ in range(n)]
c = list(map(int, input().split()))
h = []
for i in range(n):
	heappush(h, -c[i])

def dfs(x):
	global h
	for v in adj[x]:
		if num[v] != 0:
			continue
		num[v] = -heappop(h)
		dfs(v)
	return

num[0] = -heappop(h)
dfs(0)
print(sum(c) - max(c))
print(*num)
X = int(input())

if X = 7 or X = 5 or X = 3:
	print("YES")
else:
	print("NO")




### FIXED CODE ###

X = int(input())

if X == 7 or X == 5 or X == 3:
	print("YES")
else:
	print("NO")
n = input()

S = map(int, raw_input().split())

q = input()

T = map(int, raw_input().split())

cnt = 0
for j in range(q):
    for i in range(n):
        if S[i] == T[j]:
            cnt = cnt + 1
            break

print cnt

### FIXED CODE ###

n = input()

S = map(int, raw_input().split())

q = input()

T = map(int, raw_input().split())

S.append(0)
cnt = 0
for i in range(q):
    j = 0
    S[n] = T[i]
    while S[j] != S[n]:
        j = j + 1
    if j != n:
        cnt = cnt + 1


print cnt
n = int(input())

max_range = 10 ** 5
dp = [int(i) for i in range(max_range + 1)]

for i in [6,9]:
    check = i
    while check < max_range:
        for j in range(max_range + 1):
            if j - check >= 0:
                dp[j] = min(dp[j],dp[j-check] + 1)

        check =  check *
        
print(dp[n])

### FIXED CODE ###

n = int(input())
max_n = 10 ** 5

dp = [int(i) for i in range(max_n + 1)]

for i in (6,9):
    v = i
    while v < max_n:
        for j in range(len(dp)):
            if j + v < max_n+1:
                dp[j+v] = min(dp[j+v],dp[j]+1)
        v *= i
        
print(dp[n])
from collections import Counter
n = int(input())
d = list(map(int, input().split()))

if d[0] != 0:
    print(0)
    exit()

cnt = Counter(d)

if cnt[0] != 1:
    print(0)
    exit()

ans = 1
for i in d:
    if i != 0:
        ans *= cnt[i-1] % 998244353
print(and % 998244353)

### FIXED CODE ###

from collections import Counter
n = int(input())
d = list(map(int, input().split()))

if d[0] != 0:
    print(0)
    exit()

cnt = Counter(d)

if cnt[0] != 1:
    print(0)
    exit()

ans = 1
for i in d:
    if i != 0:
        ans = (ans * cnt[i-1]) % 998244353
print(ans)
h, w = map(int, input().split(' '))
print(int(h * w / 2 + h * w % 2)

### FIXED CODE ###

h, w = map(int, input().split(' '))
print(int(h * w / 2) + h * w % 2 if h > 1 and w > 1 else 1)
N = int(input())
A = list(map(int, input().split()))

ans = []
mx = max(A)
mi = min(A)

if mx * mi < 0:
    if abs(mi) > abs(mx):
        x = A.index(mi)
        for y in range(N):
            if y == x:
                continue
            A[y] += mi
            ans.append((x, y))
    else:
        x = A.index(mx)
        for y in range(N):
            if x == y:
                continue
            A[y] += mx
            ans.append((x, y))


if max(A) * min(A) < 0:
    exit()

for i in range(N - 1)[::(-1)**(max(A) < 0)]:
    l, r = A[i], A[i + 1]

    if l > r:
        if r > 0:
            A[i + 1] += l
            ans.append((i, i + 1))
        if l < 0:
            A[i] += r
            ans.append((i + 1, i))

print(len(ans))
for x, y in ans:
    print(x + 1, y + 1)

if list(sorted(A)) != A:
    print(A)
    1 / 0


### FIXED CODE ###

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

ans = []
mx = max(A)
mi = min(A)

if mx * mi < 0:
    if abs(mi) > abs(mx):
        x = A.index(mi)
        for y in range(N):
            if y == x:
                continue
            A[y] += mi
            ans.append((x, y))
    else:
        x = A.index(mx)
        for y in range(N):
            if x == y:
                continue
            A[y] += mx
            ans.append((x, y))

for i in range(N - 1)[::(-1)**(min(A) < 0)]:
    l, r = A[i], A[i + 1]

    if l > r:
        if r >= 0:
            A[i + 1] += l
            ans.append((i, i + 1))
        elif l <= 0:
            A[i] += r
            ans.append((i + 1, i))

print(len(ans))
for x, y in ans:
    print(x + 1, y + 1)

if list(sorted(A)) != A:
    print(A)
    1 / 0
n,m = map(int,input().split())
l = list(map(int,input().split()))
x = 0
a = 0
for i in range(n-3):
    b = l[i]+l[i+1]+l[i+2]+l[i+3]
    if b > a:
        a = b
        x = i

def kitai(x):
    ans = 0
    for i in range(1,x+1):
        ans += i
    return ans/x
ans = 0
for i in range(x,x+m):
    ans += kitai(l[i])
print(ans)


### FIXED CODE ###

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

ans = 0
for i in range(m):
    ans += l[i]
a = ans
for i in range(m,n):
    a = a+l[i]-l[i-m]
    if a > ans:
        ans = a
print((ans+m)/2)
import queue
h,w = map(int,input().split())
sy,sx= map(int,input().split())
gy,gx= map(int,input().split())
S=[]



for i in range(h):
    S.append(input())
    
move = [[x,y] for x in range(-2,3) for y in range(-2,3)] 
walk = [[1,0],[-1,0],[0,1],[0,-1]]
dist = [[99999]*w for i in range(h)]
#visited = [[0]*w for i in range(h)]

q=queue.Queue()
q.put((sx-1,sy-1,0))
dist[sy][sx]=0
goaled = 0

#while goaled==0:
while not q.empty():
    
    x,y,d = q.get()
    
    if x==gx-1 and y==gy-1:
        goaled=1
#        print(d)
#        break
    
    print(x,y,d)
    for i in move:
        if 0<=x+i[0]<w and 0<=y+i[1]<h:
            if S[y+i[1]][x+i[0]]!="#" :
            
#                if visited[x+i[0]][y+i[1]] == 0:
                if dist[y+i[1]][x+i[0]] > d:
                
                    

                    if abs(i[0])+abs(i[1])==1:
                        dist[y+i[1]][x+i[0]] = d
                        q.put((x+i[0],y+i[1],d+0))
                    else:  
                        dist[y+i[1]][x+i[0]] = d+1
                        q.put((x+i[0],y+i[1],d+1))

### FIXED CODE ###

from collections import deque
import sys

imput = sys.stdin.readline

h,w = map(int,input().split())
sy,sx= map(int,input().split())
gy,gx= map(int,input().split())
S=[]



for i in range(h):
    S.append(input())

walk = [[1,0],[-1,0],[0,1],[0,-1]]
move = [[x,y] for x in range(-2,3) for y in range(-2,3) if [x,y] not in walk + [[0,0]]] 

dist = [[9999999]*w for i in range(h)]
#visited = [[0]*w for i in range(h)]

q=deque()
q.append((sx-1,sy-1,0))
dist[sy-1][sx-1]=0
goaled = 0
endwarp=0
#while goaled==0:
while len(q):
    endwarp=0
    
    x,y,d = q.popleft()
    
#    if x==gx-1 and y==gy-1:
#        goaled=1
#        print(d)
#        break
    
#    print(x,y,d)
    for i in walk:
        if 0<=x+i[0]<w and 0<=y+i[1]<h and S[y+i[1]][x+i[0]]!="#" and dist[y+i[1]][x+i[0]] > d:

                    dist[y+i[1]][x+i[0]] = d
                    q.appendleft((x+i[0],y+i[1],d+0))

    for i in move:
        if 0<=x+i[0]<w and 0<=y+i[1]<h and S[y+i[1]][x+i[0]]!="#" and dist[y+i[1]][x+i[0]] > d+1:

                    dist[y+i[1]][x+i[0]] = d+1
                    q.append((x+i[0],y+i[1],d+1))
                        
                        
                         
    
    

if dist[gy-1][gx-1]==9999999:
    print(-1)
    
else:
    print(dist[gy-1][gx-1])
S = list(input())
T = list(input())
cnt = 0
for s,t in S,T:
  if s != t:
    cnt++
print(cnt)

### FIXED CODE ###

S = list(input())
T = list(input())
cnt = 0
for t in range(0,int(len(S))):
  if S[t] != T[t]:
    cnt += 1
print(cnt)
n,m = map(int,raw_input().split())
 
for i in range(n):
  a = []
  a.append(map(int, raw_input().split()))
for i in range(m):
  b = []
  b.append(input())
for i in range(n):
  ans = 0
  for j in range(m):
    ans += a[i][j]*b[j]
  print ans

### FIXED CODE ###

n,m = map(int,raw_input().split())
a = []
b = []

for i in range(n):
  a.append(map(int, raw_input().split()))
for i in range(m):
  b.append(input())
for i in range(n):
  ans = 0
  for j in range(m):
    ans += a[i][j]*b[j]
  print ans
#coding: UTF-8
import statistics as st

while True:
    N = int(input())
    if N = 0:
        break
    buf = list(map(float, input().split()))
    sd = st.pstdev(buf)
    print("%.8f"%sd)



### FIXED CODE ###

#coding: UTF-8
import statistics as st

while True:
    N = int(input())
    if N == 0:
        break
    buf = list(map(float, input().split()))
    sd = st.pstdev(buf)
    print("%.8f"%sd)
N,K = map(int,input().split())
x = list(map(int,input().split()))

xp = []
xn = []
for i in x:
    if i >= 0:
        xp += [i]
    else:
        xn += [abs(i)]
    
xn.sort()
pl = len(xp)
pn = len(xn)

ans = 2 ** 30

for i in range(pl):
    if K-2-i < pn:
        if K-2-i >= 0:
            tmp = xp[i] * 2 + xn[K-2-i]
        else:
            tmp = xp[i] 
    ans = min(ans,tmp)


for i in range(pn):
    if K-2-i < pl:        
        if K-2-i >= 0:
            tmp = xn[i] * 2 + xp[K-2-i]
        else:
            tmp = xn[i]
        
    ans = min(ans,tmp)

print(ans)

### FIXED CODE ###

N,K = map(int,input().split())
x = list(map(int,input().split()))

xp = []
xn = []
for i in x:
    if i >= 0:
        xp += [i]
    else:
        xn += [abs(i)]
    
xn.sort()
pl = len(xp)
pn = len(xn)

ans = 2 ** 30

for i in range(pl):
    if K-2-i < pn:
        if K-2-i >= 0:
            tmp = xp[i] * 2 + xn[K-2-i]
        elif i == K-1:
            tmp = xp[i] 
    else:
        continue
    ans = min(ans,tmp)


for i in range(pn):
    if K-2-i < pl:        
        if K-2-i >= 0:
            tmp = xn[i] * 2 + xp[K-2-i]
        elif i == K-1:
            tmp = xn[i]
    else:
        continue
    ans = min(ans,tmp)

print(ans)
def main():
    n, k = map(int, input().split())
    r, s, p = map(int, input().split())
    t = list(input())
    score = {"r": p, "s": r, "p": s}
    answer = 0
    for i in range(n):
        if i < k:
            answer += score[t[i]]
            if t[i] == t[i + k]:
                t[i + k] = t[i + k] + "*"
        elif i + k < n:
            if "*" not in t[i]:
                answer += score[t[i]]
                if t[i] == t[i + k]:
                    t[i + k] = t[i + k] + "*"
        else:
            if "*" not in t[i]:
                answer += score[t[i]]
    print(answer)


if __name__ == '__main__':
    main()



### FIXED CODE ###

def main():
    N, K = map(int, input().split(" "))
    R, S, P = map(int, input().split(" "))
    strings = input()
    T = []
    for s in strings:
        T.append(s)
    score = {'r': P, 's': R, 'p': S}
    total = 0

    for i in range(K):
        total += score[T[i]]

    for j in range(K, N):
        if T[j] != T[j - K]:
            total += score[T[j]]
        else:
            T[j] = ' '
            continue

    print(total)

   
if __name__ == '__main__':
    main()
from math import pi

a = int(input())
s = round(pi * (a ** 2), 11)
l = round(2 * pi * a, 11)
print(s, l)

### FIXED CODE ###

from math import pi

a = float(input())
s = round(pi * (a ** 2), 11)
l = round(2 * pi * a, 11)
print(s, l)
argN, argA, argB, argC, argD = list(map(int,input().split()))
argS = input()

if argA < argB and argC < argD:
  flgOIKOSI = False
elif argB < argA and argD < argC:
  flgOIKOSI = False
else:
  flgOIKOSI = True
#print(flgOIKOSI)
  
if "##" in argS[argA - 1:argC]:
  #print(argS[argA - 1:argC])
  print("No")
elif "##" in argS[argB - 1:argD]:
  #print(argS[argB - 1:argD])
  print("No")
elif flgOIKOSI == False:
  print("Yes")
else:
  aryS = list(argS.split("#"))
  #print(aryS)
  #print(len(max(aryS)))
  if len(max(aryS)) > 2:
    print("Yes")
  else:
    print("No")

  

### FIXED CODE ###

argA,argB = list(map(int,input().split()))

if argA >= 13:
  ans = argB
elif argA >= 6:
  ans = argB / 2
else:
  ans = 0

print(int(ans))
import math
a,b=map(int,input().split())
ans = a*b//math.gcd(a,b)
print(ans)

### FIXED CODE ###

import fractions
a,b=map(int,input().split())
ans = a*b//fractions.gcd(a,b)
print(ans)
import sys
s = list(input())

for i in range(len(s)-2):
    if s[i] == s[i+1]:
        print(i+1, i+2)
        sys.exit(0)
    if s[i] == s[i+2]:
        print(i+1, i+3)
        sys.exit(0)
if s[i+1] == s[i+2]:
    print(i+2, i+3)
    sys.exit(0)
print("-1 -1")
sys.exit(0)

### FIXED CODE ###

import sys
s = input()

for i in range(len(s)-1):
    if s[i] == s[i+1]:
        print(i+1, i+2)
        sys.exit(0)
    if i < len(s)-2:
        if s[i] == s[i+2]:
            print(i+1, i+3)
            sys.exit(0)
print("-1 -1")
sys.exit(0)
import math

n = int(input())
li_t = list()

for _ in range(n):
    li_t.append(int(input()))

# a * b = 最小公倍数 * 最大公約数


def lcm(a, b):
    return (a * b) // math.gcd(a, b)

work = 1

for t in li_t:
    work = lcm(work, t)

print(work)

### FIXED CODE ###

from fractions import gcd


n = int(input())
li_t = list()

for _ in range(n):
    li_t.append(int(input()))

# a * b = 最小公倍数 * 最大公約数


def lcm(a, b):
    return (a * b) // gcd(a, b)

work = 1

for t in li_t:
    work = lcm(work, t)

print(work)
N, K = map(int,input().split()) 
P = list(map(int,input().split()))
maxsize = 0
expectsum = 0
for i in range(N-K):
    if P[i]>=P[i+K]:
        pass 
    else:
        sum_3 = sum(P[i+1:i+K+1])
        if sum_3 >= max_size:
            max_size = sum_3
            expect = 0
            for j in range(K):
                expect += (P[i+1+j]+1)/2
                if expect > expectsum:
                    expectsum = expect
print(expect)

### FIXED CODE ###

def expect(n):
    return (int(n)+1)/2
N, K = map(int,input().split()) 
P = list(map(expect,input().split()))
sumlist = [sum(P[0:K])]
sumnumber = sum(P[0:K])
for i in range(N-K):
    sumnumber -=P[i]
    sumnumber +=P[i+K]
    sumlist.append(sumnumber)
print(max(sumlist))
L = []
L.append(input())

if L[0] == 'SSS':
	print(0)
elif L[0] == 'RRR':
	print(3)
elif L[0] == 'SSR' or L[0] == 'SRS':
	prinrt(1)
elif L[0] =='RSS':
	print(1)
elif L[0] == 'SRR' or L[0] == 'RRS':
	print(2)
elif L[0] == 'RSR':
	print(1)


### FIXED CODE ###



L = []
L.append(input())

if L[0] == 'SSS':
	print(0)
elif L[0] == 'RRR':
	print(3)
elif L[0] == 'SSR' or L[0] == 'SRS':
	print(1)
elif L[0] =='RSS':
	print(1)
elif L[0] == 'SRR' or L[0] == 'RRS':
	print(2)
elif L[0] == 'RSR':
	print(1)
x = int(imput())
 print(x ** 3)

### FIXED CODE ###

x = int(input())
print(x ** 3)
S = input()
n = len(S)
total = 0
for i in range(2**(n-1)) :
  ls = [""] * (n-1)
  
  for j in range(n) :
    if ((i >> j) & 1) :
      ls[j] = "+"
  for k in range(n) :
    if k==0 :
      fo = S[k] + ls[k]
    elif k==n-1 :
      fo = fo + S[k]
    else :
      fo = fo + S[k] + ls[k]  
  total += eval(fo)
print(total)

### FIXED CODE ###

S = input()
n = len(S)
total = 0
for i in range(2**(n-1)) :
  fo = ''
  fo = S[0]
  for j in range(n-1) :
    if ((i >> j) & 1) :
      fo += '+' 
    fo += S[j+1]
  total += sum(map(int,fo.split('+')))
print(total)
import sys
from collections import defaultdict
readline = sys.stdin.readline
N, = map(int, readline().split())
G = [[] for _ in range(N+1)]
for v in range(N-1):
    a, b = map(int, readline().split())
    G[a].append(b)
    G[b].append(a)
cd = dict()
cd[1] = 1

def itree(v, p):
    cdd = 1
    for c in G[v]:
        if c == p:
            continue
        if cdd == cd[v]:
            cdd += 1
        cd[c] = cdd
        cdd += 1
        itree(c, v)


def process():
    itree(1,0)
process()
xs = []
for i in range(N):
    xs.append(cd[i+1])
print(max(xs))
print("\n".join(map(str,xs)))


### FIXED CODE ###

import sys
from collections import defaultdict
sys.setrecursionlimit(10**5+1)
readline = sys.stdin.readline
N, = map(int, readline().split())
G = [[] for _ in range(N+1)]
ees = dict()
for v in range(N-1):
    a, b = map(int, readline().split())
    G[a].append(b)
    G[b].append(a)
    ees[v+1] = tuple([min(a,b), max(a,b)])
cd = dict()
cd[1] = 0
ed = dict()

def itree(v, p):
    cdd = 1
    for c in G[v]:
        if c == p:
            continue
        if cdd == cd[v]:
            cdd += 1
        cd[c] = cdd
        ed[tuple([min(c,v), max(c,v)])] = cdd
        cdd += 1
        itree(c, v)


def process():
    itree(1,0)
process()
xs = []
for i in range(N-1):
    xs.append(ed[ees[i+1]])
print(max(xs))
print("\n".join(map(str,xs)))
import sympy as sp
import numpy
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a
if __name__ == '__main__':
    X  = int(input())

    list_list=prime_factorize(X)
    if(len(list_list)==1):
        A=list_list[0]
        B=1
    elif(len(list_list)==0):
        A=1
        B=1
    else:
        A=list_list[0]
        B=numpy.prod(list_list[1:])

    sp.init_printing()
    sp.var('x, y, a, b, c, d, e, f')
    eq1=sp.Eq(x-y, A)
    eq2=sp.Eq(x**4+x**3*y+x**2*y**2+x*y**3+y**4, B)
    sorver_list=sp.solve ([eq1, eq2], [x, y])
    print(str(sorver_list[0][0])+' '+str(sorver_list[0][1]))


### FIXED CODE ###

X=int(input())

for i in range(-120,120):
    for j in range(-120,120):
        if(i**5-j**5==X):
            print(i,j)
            exit()
N, A, B = map(int, input().split())
ans = 0
for i in range(1, N+1):
  x = sum(list(map(str, i)))
  if A <= X <= B:
    ans += i
print(ans)

### FIXED CODE ###

N, A, B = map(int, input().split())
ans = 0
for i in range(1, N+1):
  x = sum(list(map(int, str(i))))
  if A <= x <= B:
    ans += i
print(ans)
N = int(input())
d = {}
for i in range(N):
  d[input()] = 0
print(len(dict))

### FIXED CODE ###

N = int(input())
d = {}
for i in range(N):
    d[input()] = 0
print(len(d))
from numpy import array, sum, argmax
import heapq

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

A *= -1

heapq.heapify(A)

for i in range(M):
  tmp = heapq.heappop(A) * (-1)
  heapq.heappush(A, -(tmp // 2))

print(-sum(A))


### FIXED CODE ###

import heapq

N,M = list(map(int,input().split()))
A_tmp = [int(i) for i in input().split()]

#print(A_tmp)
A = [-i for i in A_tmp]

heapq.heapify(A)
#print(A)

for i in range(M):
  tmp = heapq.heappop(A)
  heapq.heappush(A, -(-tmp // 2))
  #print(A)

print(-sum(A))