Harryxun/stf_run huggingface dataset:
print(4 - 2 * S.count("c"))

### FIXED CODE ###

def main():
    S = input()
    c = S.count("-")
    print(4 - 2 * c)
    return 0
main()
N,M=map(int,input().split())
S=list(input())
S=S[::-1]
ans=[]
P=0
for i in range(1,N+1):
    if P==N:
        break
    for j in range(M+1):
        if P+(M-j)<=N and S[P+(M-j)]=="0":
            ans.append(M-j)
            P+=M-j
            if M-j==:
                print(-1)
                exit()
            break
ans=ans[::-1]
if 0 in ans:
    print(-1)
else:
    print(*ans)

### FIXED CODE ###

N,M=map(int,input().split())
S=list(input())
S=S[::-1]
ans=[]
P=0
for i in range(1,N+1):
    if P==N:
        break
    for j in range(M+1):
        if P+(M-j)<=N and S[P+(M-j)]=="0":
            ans.append(M-j)
            P+=M-j
            if M-j==0:
                print(-1)
                exit()
            break
ans=ans[::-1]
if 0 in ans:
    print(-1)
else:
    print(*ans)
import math

x1, y1, x2, y2 = [int(n) for n in raw_input().split()]
print(math.sqrt(abs(x2 - x1) ** 2 + abs(y2 - y1) ** 2))

### FIXED CODE ###

import math

x1, y1, x2, y2 = [float(n) for n in raw_input().split()]
print math.sqrt(abs(x2 - x1) ** 2 + abs(y2 - y1) ** 2)
S, T = input().split()
A, B = map(int, input().split())
U = input()
if U == S:
  print(A-1, B):
else:
  print(A, B-1)

### FIXED CODE ###

S, T = input().split()
A, B = map(int, input().split())
U = input()
if U == S:
  print(A-1, B)
else:
  print(A, B-1)
N,K=map(int,input().split())
H=sorted(list(map(int,input().split())),reverse=True)
for i in range(K):H[i]=0
print(sum(H))


### FIXED CODE ###

N,K=map(int,input().split())
H=sorted(list(map(int,input().split())),reverse=True)
if N<K:K=N
for i in range(K):H[i]=0
print(sum(H))
nk = map(int,input().split(" "))
print(nk[0] % nk[1]) 

### FIXED CODE ###

nk = list(map(int,input().split(" ")))
l = [(nk[0] + i) // nk[1] for i in range(nk[1])]
print(max(l) - min(l))
from collections import deque
from typing import List


def main():
    n = int(input())
    v = input().split("")
    print(pp(n, v))


def pp(n: int, v: List[str]) -> List[str]:
    x = []
    y = deque([])

    if n % 2 == 0:
        for i in range(n):
            if i % 2 == 0:
                y.append(v[i])
            else:
                x.append(v[i])
    else:
        for i in range(n):
            if i % 2 == 0:
                x.append(v[i])
            else:
                y.append(v[i])

    ret = []
    for i in range(len(x)):
        ret.append(x.pop())

    for i in range(len(y)):
        ret.append(y.popleft())

    return ret


if __name__ == "__main__":
    main()


### FIXED CODE ###

from collections import deque
from typing import List


def main():
    n = int(input())
    v = input().split(" ")
    print(*pp(n, v))


def pp(n: int, v: List[str]) -> List[str]:
    x = []
    y = deque([])

    if n % 2 == 0:
        for i in range(n):
            if i % 2 == 0:
                y.append(v[i])
            else:
                x.append(v[i])
    else:
        for i in range(n):
            if i % 2 == 0:
                x.append(v[i])
            else:
                y.append(v[i])

    ret = []
    for i in range(len(x)):
        ret.append(x.pop())

    for i in range(len(y)):
        ret.append(y.popleft())

    return ret


if __name__ == "__main__":
    main()
n=int(input())
listx=list(map(int,input().split()))
listx.sort()
x=1
if listx[0]!=0:
  x=0
else:
  for i in range(listx[-1]):
    print(i+1)
    x*=listx.count(int(i+1))+1
print(x)

### FIXED CODE ###

n=int(input())
if n%2==0:
  print(int(n/2-1))
else:
  print(int((n-1)/2))
tmp=map(int, raw_input().split(" "))
a=abs(tmp[0]-tmp[1])
b=abs(tmp[0]-tmp[2])
if a<b:
    print("A")
else:
    print("B")

### FIXED CODE ###

tmp=map(int, raw_input().split(" "))
a=abs(tmp[0]-tmp[1])
b=abs(tmp[0]-tmp[2])
if a<b:
    print("A")
else:
    print("B")
print(len(max(input().split('S')))

### FIXED CODE ###

print(len(max(input().split('S'))))
import math
num=int(input())
a,b=num.split()

if a%2!=0 and b%2!=0:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

import math
num=input().split()
a=int(num[0])
b=int(num[1])

if a!=2 and b!=2:
    print("Yes")
else:
    print("No")
x = '#'
while True:
	H,W = map(int(input().split()))
	if ( H * W == 0):
		break
	for i in range(H):
		print(x*W)
	print('/n')



### FIXED CODE ###

x = '#'
while True:
	H,W = map(int,input().split())
	if ( H * W == 0):
		break
	for i in range(H):
		print(x*W)
	print()
n=int(input())
s=input()
sorted(s)
print(s[n:]+(s-s[n:]))

### FIXED CODE ###

n=int(input())
s=input()
word=""
for i in range(len(s)):
    if ord(s[i])+n>90:
        word+=chr(ord(s[i])+n-26)
    else:
        word+=chr(ord(s[i])+n)
print(word)
A = int(input())
B = int(input())
if B%2==0:

    if A>12:
        print(B)
    elif 13>A>5:
        print(round(B/2))
    else:
        print(0)


### FIXED CODE ###

a,b = map(int,input().split());print(b//-~(a<13)*(a>5))
import bisect


def primes(n):
    sieve = [True] * n
    for i in range(3, int(n ** 0.5) + 1, 2):
        if sieve[i]:
            sieve[i * i::2 * i] = [False] * (int((n - i * i - 1) / (2 * i)) + 1)
    return [2] + [i for i in range(3, n, 2) if sieve[i]]


q = int(input())
array = [[int(x) for x in input().split()] for z in range(q)]

primes_array = primes(10000)
res_primes = [0 for x in range(10000+1)]
cum_sum = 0
for x in range(10000+1):
    if x in primes_array and (x+1) // 2 in primes_array:
        cum_sum += 1
    res_primes[x] = cum_sum

for l, r in array:
    res = res_primes[r] - res_primes[l-1]
    print(res)

### FIXED CODE ###

import math
import bisect


def is_prime(x):
    if x < 2: return False # 2未満に素数はない
    if x == 2 or x == 3 or x == 5: return True # 2,3,5は素数
    if x % 2 == 0 or x % 3 == 0 or x % 5 == 0: return False # 2,3,5の倍数は合成数

    # ためし割り: 疑似素数(2でも3でも5でも割り切れない数字)で次々に割っていく
    prime = 7
    step = 4
    while prime <= math.sqrt(x):
        if x % prime == 0: return False

        prime += step
        step = 6 - step

    return True


if __name__ == '__main__':
    q = int(input())
    array = [[int(x) for x in input().split()] for x in range(q)]
    nearby_2017 = [x for x in range(1, 100000, 2) if is_prime(x) and is_prime((x+1)/2)]
    for i, j in array:
        print(bisect.bisect_right(nearby_2017, j) - bisect.bisect_left(nearby_2017, i))
import numpy as sp
n,k=map(int,input().split())
xy=[list(map(int,input().split())) for i in range(n)]
xy = sp.reshape(sp.array(xy), (n, 2))
def ABC075D(n, k, xy):
    x = xy[:, 0]
    y = xy[:, 1]
    Min = sp.inf
    for x1 in range(n-1):
        for x2 in range(x1+1, n):
            minx = min(x[x1], x[x2])
            maxx = max(x[x1], x[x2])
            for y1 in range(n-1):
                for y2 in range(y1+1, n):
                    count = 0
                    for i in range(n):
                        if minx <= x[i] <= maxx and min(y[y1], y[y2]) <= y[i] <= max(y[y1], y[y2]):
                            count += 1
                    if count == k:
                        Min = min(Min, abs((x[x1]-x[x2])*(y[y1]-y[y2])))
    print(Min)
n,k=map(int,input().split())
xy=[list(map(int,input().split())) for i in range(n)]
ABC075D(n,k,xy)

### FIXED CODE ###

n,k=map(int,input().split())
x,y=[[0,0] for i in range(n)],[[0,0] for i in range(n)]
xy=[list(map(int,input().split())) for i in range(n)]
for i in range(n):
    x_sub,y_sub=xy[i]
    x[i][0]=x_sub
    x[i][1]=i
    y[i][0]=y_sub
    y[i][1]=i
x.sort()
y.sort()
ans=(10**18)*5
for i1 in range(n):
    for l1 in range(n-i1,1,-1):
        for i2 in range(n):
            for l2 in range(n-i2,1,-1):
                x_sub1=x[i1][0]
                x_sub2=x[i1+l1-1][0]
                y_sub1=y[i2][0]
                y_sub2=y[i2+l2-1][0]
                z=[0]*n
                for i in range(n):
                    if x_sub1<=xy[i][0]<=x_sub2 and y_sub1<=xy[i][1]<=y_sub2:
                        z[i]=1
                if sum(z)>=k:
                    ans=min((x_sub2-x_sub1)*(y_sub2-y_sub1),ans)
                else:
                    break
print(ans)
mod = int(1e9 + 7)
N = int(input())
A = list(map(int, input().split()))
S = 0
j = 0
while A != []:
  m = 0
  n = len(A)
  k = []
  for i in range(n):
    if A[i] % 2 == 1:
      m += 1
    A[i] //= 2
    if A[i] == 0:
      k.append(i)
  for g in range(len(k)):
    A.remove(k[len(k)-1-g])
  S += (m * (N - m)) * (2 ** j)
  S %= mod
  j += 1
print(S)

### FIXED CODE ###

mod = int(1e9 + 7)
N = int(input())
A = [format(i, '060b') for i in map(int, input().split())]
S = 0
for k in range(60):
  s = [b[59-k] for b in A]
  v = s.count('0')*s.count('1')
  S += (v<<k)
S %= mod
print(S)
# coding: utf-8
# Here your code !

def calculate_minkowski_distances():
    _ = input()
    data = []
    for i in range(2):
        data.append([int(value) for value in input().rstrip().split()])

    for exponent in (1, 2, 3, float("inf")):
        print(minkowski_distance(*data, exponent))
#        print("{0:.8f}".format(minkowski_distance(*data, exponent)))

def minkowski_distance(vector_x, vector_y, exponent):
#    abs_xy = [ abs(pair[0] - pair[1]) for pair in zip(vector_x, vector_y) ]
    abs_xy = [abs(vector_x[i] - vector_y[i]) for i in range(len(vector_x))]
    
    m_dis = 0
    if exponent == float("inf") :
        m_dis = max(abs_xy)
    elif exponent == 0 :
        m_dis = nan
    else :
        m_dis = sum([ elem**exponent for elem in abs_xy ])**(1/exponent)
    
    return m_dis

if __name__ == "__main__" :
    calculate_minkowski_distances()
    
    

### FIXED CODE ###

# coding: utf-8
# Here your code !

def calculate_minkowski_distances():
    _ = input()
    data = []
    for i in range(2):
        data.append([float(value) for value in input().rstrip().split()])

    for exponent in (1, 2, 3, float("inf")):
        print(minkowski_distance(data[0],data[1], exponent))
#        print("{0:.8f}".format(minkowski_distance(*data, exponent)))

def minkowski_distance(vector_x, vector_y, exponent):
#    abs_xy = [ abs(pair[0] - pair[1]) for pair in zip(vector_x, vector_y) ]
    abs_xy = [abs(vector_x[i] - vector_y[i]) for i in range(len(vector_x))]
    
    m_dis = 0
    if exponent == float("inf") :
        m_dis = max(abs_xy)
    elif exponent == 0 :
        m_dis = nan
    else :
        m_dis = sum([ elem**exponent for elem in abs_xy ])**(1/exponent)
    
    return m_dis

if __name__ == "__main__" :
    calculate_minkowski_distances()
a,b=map(int,input().split())
if b==1:
    print(0)
elif a<b:
    print(b//a+1)
elif a==B:
    priint(b//a)
else:
    print(1)

### FIXED CODE ###

a,b=map(int,input().split())
if b==1:
    print(0)
elif a<b:
    x=(b-1)//(a-1)
    if (b-1)%(a-1)==0:
        print(x)
    else:
        print(x+1)
else:
    print(1)
# -*- coding: utf-8 -*-
# python template for atcoder1
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline

MOD = 10**9+7


def solve2():
    L = input()[:-1]
    int_L = int(L, 2)
    ans = 1  # (0,0)のぶん
    for l in range(1, int_L+1):  # 10**6
        bit_cnt = bin(l).count("1")  # 遅そうO(len(bin(l)))
        ans += pow(2, bit_cnt, MOD)
        ans %= MOD
    print(ans)


def solve3():
    L = input()[:-1]
    # dp[smaller?][上からi桁目まで見た] = 何通りあるか?
    dp = [0]*2
    dp[0][0] = 1  # 0

    for i, c in enumerate(L):
        tmp = [0]*2
        tmp[0] = dp[0]*(int(c)+1)
        tmp[1] = dp[1]*3+dp[0]*int(c)

        tmp[0] %= MOD
        tmp[1] %= MOD
        dp = tmp
    print(sum(dp[-1]) % MOD)


solve3()


### FIXED CODE ###

# -*- coding: utf-8 -*-
# python template for atcoder1
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline

MOD = 10**9+7


def solve2():
    L = input()[:-1]
    int_L = int(L, 2)
    ans = 1  # (0,0)のぶん
    for l in range(1, int_L+1):  # 10**6
        bit_cnt = bin(l).count("1")  # 遅そうO(len(bin(l)))
        ans += pow(2, bit_cnt, MOD)
        ans %= MOD
    print(ans)


def solve3():
    L = input()[:-1]
    # dp[smaller?][上からi桁目まで見た] = 何通りあるか?
    dp = [[0]*2 for _ in range(len(L)+1)]
    dp[0][0] = 1  # 0

    for i, c in enumerate(L):
        dp[i+1][0] = dp[i][0]*(int(c)+1)
        dp[i+1][1] = dp[i][1]*3+dp[i][0]*int(c)

        dp[i+1][0] %= MOD
        dp[i+1][1] %= MOD
    print(sum(dp[-1]) % MOD)


solve3()
#!/usr/bin/env python3
#ABC128 E

import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(1000000)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

n,q = LI()
stx = [LI() for _ in range(n)]
stx.sort(key = itemgetter(2))
d = [I() for _ in range(q)]
ans = [-1]*q
right = [0]*q
for s,t,x in stx:
    l,r = bl(d,s-x),bl(d,t-x)
    #l≦d<rを満たすdがxでぶつかる
    #各dにおいて一番最初にぶつかるxを求めたい
    print(l,r)
    while l < r:
        while ans[l] != -1:
            l = right[l]
        if r <= l:
            break
        ans[l] = x
        right[l] = r
for i in ans:
    print(i)


### FIXED CODE ###

#!/usr/bin/env python3
#ABC128 E

import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(1000000)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

n,q = LI()
stx = [LI() for _ in range(n)]
stx.sort(key = itemgetter(2))
d = [I() for _ in range(q)]
ans = [-1]*(q+1)
right = [0]*q
for s,t,x in stx:
    l,r = bl(d,s-x),bl(d,t-x)
    #l≦d<rを満たすdがxでぶつかる
    #各dにおいて一番最初にぶつかるxを求めたい
    while l < r:
        while ans[l] != -1:
            l = right[l]
        if r <= l:
            break
        ans[l] = x
        right[l] = r
        l += 1
for i in ans[:-1]:
    print(i)
N = int(input())
A = list(map(int, input().split()))
print("YES") if len(A) == len(list(set(A))) else print("NO")


### FIXED CODE ###

S, T = map(str, input().split())
A, B = map(int, input().split())
U = str(input())
if S == U:
    A -= 1
else:
    B -= 1
print("{0} {1}".format(A, B))
alpha="abcdefghijklmnomqrstuvwxyz"
inp=input()
def split(w):
    return [all for all in w]
alpha=split(alpha)
x=alpha.index(inp)
print(alpha[x+1])

### FIXED CODE ###

alpha="abcdefghijklmnopqrstuvwxyz"
inp=input()
def split(w):
    return [all for all in w]
alpha=split(alpha)
x=alpha.index(inp)
try:
    print(alpha[x+1])
except:
    print("a")
import math
def combination(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
n, m = map(int, input().split())
n_def = n
natural = list(range(2,400))
index = 0
while index < len(natural):
	for number in natural:
		if number % natural[index] == 0 and number / natural[index] != 1:
			natural.remove(number)
	index += 1
prime = natural

prime_division = {}
index = 0
number_prime = 0
while prime[index] <= m:
	if m % prime[index] == 0:
		m /= prime[index]
		number_prime += 1
		continue		
	else:
		prime_division[prime[index]] = number_prime
		number_prime = 0
		index += 1
else:
	prime_division[prime[index]] = number_prime

list_division = list(prime_division.values())
ans = 1
for i in list_division:
#print(combination(i+n-1,n-1))
	ans *= combination(i+n-1,n-1)
print(int(ans%(10**9 + 7)))

### FIXED CODE ###

import math
def fact(a,b):
    ans = 1
    while a != b:
        ans *= a
        a -= 1
    return ans
def nCr(n,r):
    return (fact(n,r)) // (math.factorial(n-r))
def nHr(n,r):
    return nCr(n+r-1, r-1)
def prime(n): # nまでの素数を列挙
    import math
    num_list = [i + 1 for i in range(2,n,2)]
    list_prime = [2]
    limit = math.sqrt(n)
    if n == 2:
        return list_prime
    else:
        while True:
            p = num_list[0]
            if p >= limit:
                return list_prime + num_list
            list_prime.append(p)
            num_list = [num for num in num_list if num % p != 0]

def primeFactorization(n):
    import math
    list_prime = prime(int(math.sqrt(n)))
    i = 0
    dict_pF = {}
    dict_primeFactorization = {}
    for pri in list_prime:
        dict_pF[pri] = 0
    while True:
        if n == 1:
            for key, value in dict_pF.items():
                if value != 0:
                    dict_primeFactorization[key] = value
            return dict_primeFactorization
        elif i >= len(list_prime):
            dict_pF[n] = 1
            for key, value in dict_pF.items():
                if value != 0:
                    dict_primeFactorization[key] = value
            return dict_primeFactorization
        p = list_prime[i]
        if n % p == 0:
            n //= p
            dict_pF[p] += 1
            continue
        else:
            i += 1

ans = 1
n,m = map(int, input().split())
if m == 1:
    ans = 1
else:
    for factor,degree in primeFactorization(m).items():
        ans *= (nHr(degree,n)) % (10**9+7)
        
print(ans % (10**9+7))
s=set(input())
a=set("a","b","c")
print("Yes"if s==a else"No")

### FIXED CODE ###

s=set(input())
a=set(["a","b","c"])
print("Yes"if s==a else"No")
import sys

l_1 = [1,3,5,7,8,10,12]
l_2 = [4,6,9,11]

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

if x == 2:
    if y == 2:
        print("yes")
    else:
        print("no")
elif x in l_1:
    if y in x_1:
        print("yes")
    else:
        print("no")
else x in l_2:
    if y in l_2:
        print("yes")
    else:
        print("no")

### FIXED CODE ###

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

a = [0,1,3,1,2,1,2,1,1,2,1,2,1]

if a[x] == a[y]:
    print("Yes")
else:
    print("No")
n = int(input())-1
x = 26
d = 1
while n > x:
  n -= x
  d += 1
  x *= 26
  
ans = ""
al = list("abcdefghijklmnopqrstuvwxyz")
tmp = pow(26,d)
for i in range(d-1,-1,-1):
  tmp //= 26 
  ans += al[n//tmp]
  n %= tmp
print(ans)

### FIXED CODE ###

n = int(input())-1
x = 26
d = 1
while n >= x:
  n -= x
  d += 1
  x *= 26
  
ans = ""
al = list("abcdefghijklmnopqrstuvwxyz")
tmp = pow(26,d)
for i in range(d-1,-1,-1):
  tmp //= 26 
  ans += al[n//tmp]
  n %= tmp
print(ans)
n,k = map(int,input().split())
d = list(input().split())
ans = n
while True:
    flag = False
    for i in d:
        if flag :break
        if i in str(ans):
            x = len(str(n)) - str(n).index(i) - 1
            ans += 10**x
            flag = True
    if flag:continue
    print(ans)
    break


### FIXED CODE ###

n,k = map(int,input().split())
d = list(input().split())
ans = n
while True:
    flag = False
    for i in d:
        if flag :break
        if i in str(ans):
            ans += 1
            flag = True
    if flag:continue
    break
print(ans)
d = {}
while 1:
  n = int(raw_input())
  if n==0: break
  c = 0
  while n != 1
    if n % 2 ==0: n/=2
    else: n = n*3+1
    c += 1
  print c

### FIXED CODE ###

while 1:
  n = input()
  if n==0: break
  c=0
  while n>1:
    n = n*3+1 if n%2 else n/2
    c += 1
  print c
import math
import sympy
n=int(input())
ans=0
for i in range(1,n):
    ans+=len(sympy.divisors(n-i))
print(ans)

### FIXED CODE ###

n=int(input())
ans=0
for a in range(1, n):
    ans+=(n - 1)//a
print(ans)
n = int(input())
xy = []

for i in range(n):
    a = int(input())
    temp = {}
    for j in range(a):
        x, y = map(int, input().split())
        temp[x] = y
    xy.append(temp)

ans = 0

for i in range(0, 2**n):
    # print('\n', i, bin(i))
    isValid = True
    temp = 0

    for k in range(len(xy)):
        hMap = xy[k]
        kBit = (i >> k) & 1
        # print('k:', k, 'kBit:', kBit)
        if kBit == 1:
            # print('hMap is correct:', hMap)
            for key, value in hMap.items():
                # print(key, value, (i >> (key-1)) & 1, 'must be same')
                if not (i >> (key-1)) & 1 == value:
                    # print('paradox!')
                    isValid = False
                    break
        else:
            # print('hMap is NOT correct:', hMap)
            for key, value in hMap.items():
                # print(key, value, (i >> (key-1)) & 1, 'must be different')
                if not (i >> (key-1)) & 1 != value:
                    # print('paradox!')
                    isValid = False
                    break
    if isValid:
        for j in range(n):
            # print('Check digit:', j)
            jBit = (i >> j) & 1
            # print('bit:', jBit)
            if jBit == 1:
                temp += 1
    	ans = max(ans, temp)

print(ans)

### FIXED CODE ###

n = int(input())
xy = []

for i in range(n):
    a = int(input())
    temp = {}
    for j in range(a):
        x, y = map(int, input().split())
        temp[x] = y
    xy.append(temp)

ans = 0

for i in range(0, 2**n):
    # print('\n', i, bin(i))
    isValid = True
    temp = 0

    for k in range(len(xy)):
        hMap = xy[k]
        kBit = (i >> k) & 1
        # print('k:', k, 'kBit:', kBit)
        if kBit == 1:
            # print('hMap is correct:', hMap)
            for key, value in hMap.items():
                # print(key, value, (i >> (key-1)) & 1, 'must be same')
                if not (i >> (key-1)) & 1 == value:
                    # print('paradox!')
                    isValid = False
                    break
        # else:
        #     # print('hMap is NOT correct:', hMap)
        #     for key, value in hMap.items():
        #         # print(key, value, (i >> (key-1)) & 1, 'must be different')
        #         if not (i >> (key-1)) & 1 != value:
        #             # print('paradox!')
        #             isValid = False
        #             break
    if isValid:
        for j in range(n):
            # print('Check digit:', j)
            jBit = (i >> j) & 1
            # print('bit:', jBit)
            if jBit == 1:
                temp += 1
        ans = max(ans, temp)

print(ans)
arr = input().split(" ")
A = int(arr[0])
B = int(arr[1])

K = (A + B) / 2
if isinstance(K, int) == true:
  print(K)
else:
  print("IMPOSSIBLE")

### FIXED CODE ###

arr = input().split(" ")
A = int(arr[0])
B = int(arr[1])
 
if (A + B) % 2 == 0:
    print(int((A + B) / 2))
else:
    print("IMPOSSIBLE")
s = input()
l = [s[0]]
d = len(s) - 1
def operate_1(string):
  return string
def operate_2(string):
  string += "+"
  return string
# l,d は未定義注意
def bfs(list_hoge = l,depth = 0,deepest = d):
    queue = []
    for e in list_hoge:
        for b in [0,1]:
            if b == 0:
                operated = operate_1(e)
                operated += s[depth + 1]
                queue.append(operated)
            elif b == 1:
                operated = operate_2(e)
                operated += s[depth + 1]
                queue.append(operated)
    list_hoge = queue[:]
    depth += 1
    if depth == deepest:
        return list_hoge
    else:
        return bfs(list_hoge,depth)
ans = 0
for e in bfs():
  ans += eval(e)
print(ans)

### FIXED CODE ###

s = input()
l = [s[0]]
d = len(s) - 1
if d == 0:
  print(s)
  exit()
def operate_1(string):
  return string
def operate_2(string):
  string += "+"
  return string
# l,d は未定義注意
def bfs(list_hoge = l,depth = 0,deepest = d):
    queue = []
    for e in list_hoge:
        for b in [0,1]:
            if b == 0:
                operated = operate_1(e)
                operated += s[depth + 1]
                queue.append(operated)
            elif b == 1:
                operated = operate_2(e)
                operated += s[depth + 1]
                queue.append(operated)
    list_hoge = queue[:]
    depth += 1
    if depth == deepest:
        return list_hoge
    else:
        return bfs(list_hoge,depth)
ans = 0
for e in bfs():
  ans += eval(e)
print(ans)