Harryxun/stf_run huggingface dataset:
# D
n = int(input())
a = list(map(int, input().split()))

l_minus = [i for i in a if i < 0]
l_plus = [i for i in a if i >= 0]
ans = 0
if len(l_minus) % 2 == 0:
    l_minus_edit = [-i for i in l_minus]
else:
    l_minus_edit = [-i for i in l_minus]
    plus = min(l_plus)
    minus = min(l_minus_edit)
    l_minus_edit.append(-min(plus, minus) * 2)
    
ans = sum(l_plus) + sum(l_minus_edit)
print(ans)

### FIXED CODE ###

# D
n = int(input())
a = list(map(int, input().split()))

l_minus = [i for i in a if i <= 0]
l_plus = [i for i in a if i > 0]

ans = 0
if len(l_minus) % 2 == 0:
    l_minus_edit = [-i for i in l_minus]
else:
    l_minus_edit = [-i for i in l_minus]
    temp = l_plus[:]
    temp.extend(l_minus_edit)
    l_minus_edit.append(-min(temp) * 2)

ans = sum(l_plus) + sum(l_minus_edit)
print(ans)
x =  int(input())[-1]
if x == [2,4,5,7,9]:
    print("hon")

elif x == [0,1,6,8]:
    print("pon")

else:
    print("bon")

### FIXED CODE ###

x = int(input()[-1])

if x in [2,4,5,7,9]:
    print("hon")

elif x in [0,1,6,8]:
    print("pon")

else:
    print("bon")
from math import factorial
N=int(input())
L=input()
L=L.split()
L=[int(item) for item in L]
L.sort()
ans=factorial(N)/factorial(3)/factorial(N-3)
for i in range(N-2):
    for j in range(i+1,N-1):
        for k in range(j+1,N):
            if (L[i]+L[j])<=L[k]:
                ans-=(N-k)
                break


print(int(ans))

### FIXED CODE ###

from operator import mul
from functools import reduce
import bisect

def cmb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under

N=int(input())
L=input()
L=L.split()
L=[int(item) for item in L]
L.sort()
ans=cmb(N,3)
ans2=0
for i in reversed(range(2,N)):
    for j in reversed(range(1,i)):
        a=bisect.bisect_right(L,L[i]-L[j])
#        print('{0}:{1}'.format(a,j))
#        print(a)
        if(a<j):
            ans2+=(j-a)
    

print(ans2)
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))

def binary_search(lis, item):
    low = 0
    high = len(lis) - 1
    inRange = high

    if lis[0] > item:
        return 0

    while low <= high:
        mid = (low + high) //2
        guess1 = lis[mid]
        if mid < inRange:
            guess2 = lis[mid+1]
        else:
            if lis[mid] <= item:
                return len(lis)
            else:
                return len(lis)-1
        if guess1 <= item < guess2:
            return mid+1
        if guess1 > item:
            high = mid-1
        else:
            low = mid+1
    return 0

n,m,k = iim()
a = iil()
cuma = []
if a[0] <= k:
    cuma.append(a[0])
    for i in range(n-1):
        num = cuma[-1]+a[i+1]
        if num > k:
            break
        else:
            cuma.append(num)
#print(len(cuma))
b = iil()
cumb = []
if b[0] <= k:
    cumb.append(b[0])
    for i in range(m-1):
        num = cumb[-1]+b[i+1]
        if num > k:
            break
        else:
            cumb.append(num)
#print(len(cumb))

ans = binary_search(cumb,k)
#print(ans)
if len(cuma) > 0:
    cnt = len(cuma)
    for i,item in enumerate(cuma[::-1]):
        tmp = cnt-i
        res = k-item
        plus = binary_search(cumb,res)
        ans = max(ans,tmp+plus)
print(ans)
#print(ans)

#print(cuma)
#print(cumb)


### FIXED CODE ###

def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))

def binary_search(lis, item):
    low = 0
    high = len(lis) - 1
    inRange = high

    if lis[0] > item:
        return 0

    while low <= high:
        mid = (low + high) //2
        guess1 = lis[mid]
        if mid < inRange:
            guess2 = lis[mid+1]
        else:
            if lis[mid] <= item:
                return len(lis)
            else:
                return len(lis)-1
        if guess1 <= item < guess2:
            return mid+1
        if guess1 > item:
            high = mid-1
        else:
            low = mid+1
    return 0

n,m,k = iim()
a = iil()
cuma = []
if a[0] <= k:
    cuma.append(a[0])
    for i in range(n-1):
        num = cuma[-1]+a[i+1]
        if num > k:
            break
        else:
            cuma.append(num)
#print(len(cuma))
b = iil()
cumb = []
if b[0] <= k:
    cumb.append(b[0])
    for i in range(m-1):
        num = cumb[-1]+b[i+1]
        if num > k:
            break
        else:
            cumb.append(num)
#print(len(cumb))

ans = len(cumb)
#print(ans)
if len(cuma) > 0:
    cnt = len(cuma)
    for i,item in enumerate(cuma[::-1]):
        tmp = cnt-i
        res = k-item
        plus = binary_search(cumb,res)
        ans = max(ans,tmp+plus)
print(ans)
#print(ans)

#print(cuma)
#print(cumb)
x = input()
printt(x*x*x)


### FIXED CODE ###

x = int(input())
print(x*x*x)
n = int(input())
t = str(input())

if (n !== len(t)): print("No")
else:
	nHalf = int(n / 2)

	if (nHalf == 1):
		print("No")
	elif (n == 0):
		print("No")
	else:
	    if (t[:nHalf] == t[nHalf:]):
	    	print("Yes")
	    else:
	    	print("No")

### FIXED CODE ###

n = int(input())
t = str(input())

if (n != len(t)):
	print("No")
else:
	nHalf = int(n / 2)

	if (nHalf == 1 and n != 2):
		print("No")
	elif (n == 0):
		print("No")
	else:
		if (t[:nHalf] == t[nHalf:]):
			print("Yes")
		else:
			print("No")
n=int(input())

list=[]

for i in range(1,int(n+1/2)):
    a=n%i
    if a == 0:
        if(i<n/i):
            list.append([i,int(n/i)])
        else:
            list.append([int(n/i),i])
            if len(list) == 1:
                ans=(list[-1][0]-1)+(list[-1][1]-1)
                break
            if list[-1]==list[-2]:
                ans=(list[-1][0]-1)+(list[-1][1]-1)
print(ans)


### FIXED CODE ###

import math

n = int(input())

for i in range(int(math.sqrt(n)), 0, -1):
  if n % i == 0:
    print(int(i + n / i - 2))
    break
S = input()
flg = False
if len(S) < 2:
  print('No')
else:
  for i in range(len(S)-1):
    if S[i:i+2] = 'hi':
      print('Yes')
      flg = True
      break
  if not flg:
    print('No')
  

### FIXED CODE ###

S = input()
flg = True
if len(S)%2 == 1:
  print('No')
else:
  for i in range(0, len(S), 2):
    if S[i:i+2] != 'hi':
      print('No')
      flg = False
      break
  if flg:
    print('Yes')
from fractions import gcd
n,m = map(int, input().split())
a = list(map(int, input().split()))
lcm = 1
for i in a:
  lcm = lcm // gcd(lcm,i) * i
ans = m // lcm
if (ans+0.5) * lcm <= m:
  ans += 1
sum = 0
for i in a:
  if (lcm // i) % 2 == 1:
    sum += 1
if sum != len(a):
  ans = 0
print(ans)


### FIXED CODE ###

from fractions import gcd
n,m = map(int, input().split())
a = list(map(int, input().split()))
b = []
lcm = 1
for i in a:
    b.append(i//2)
for i in b:
  lcm = lcm // gcd(lcm,i) * i
ans = m // lcm
sum = 0
for i in b:
  if (lcm // i) % 2 == 1:
    sum += 1
if sum != len(a):
  print(0)
elif ans%2 ==1:
    print((ans+1)//2)
else:
    print(ans//2)
n,k  = map(int,input().split())
s = input()
print(s[:k] +chr(ord(s[k])+32)+ s[k+1:])

### FIXED CODE ###

n,k  = map(int,input().split())
s = input()
print(s[:k-1] +chr(ord(s[k-1])+32)+ s[k:])
n, m = map(int, input().split())

box = []
for i in range(m):
    a, b = map(int, input().split())
    c = list(map(int, input().split()))
    box.append([a, c])

box.sort(key=lambda x: x[0])

memo = [0] * n
tmp = []

ans = 0

for i in range(m):
    cost = box[i][0]
    target = box[i][1]

    for t in target:
        t -= 1
        memo[t] += 1
    ans += cost
    tmp.append(i)

    cost_max = 0
    bit_max = 0
    for bit in range(2**(i+1)):
        memo_sub = [0] * n
        cost_sub = 0
        for j in range(i+1):
            if (1 << j) & bit:
                co = box[j][0]
                ta = box[j][1]
                cost_sub += co
                for t in ta:
                    t -= 1
                    memo_sub[t] += 1
        flag = 1
        for k in range(n):
            if memo_sub[k] >= memo[k]:
                flag = 0
        if flag:
            if cost_sub > cost_max:
                cost_max = cost_sub
                bit_max = bit

    for j in range(i+1):
        if (1 << j) & bit_max:
            tmp.remove(j)
            for t in box[j][1]:
                t -= 1
                memo[t] -= 1
    ans -= cost_max

for mi in memo:
    if mi == 0:
        print(-1)
        exit()

print(ans)




### FIXED CODE ###

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

INF = float('inf')
dp = [INF for j in range(2**n)]

dp[0] = 0

for i in range(m):
    a, b = map(int, input().split())
    c = map(int, input().split())

    k = 0
    for ci in c:
        ci -= 1
        k |= (1 << ci)
    for j in range(2**n):
        l = k | j
        dp[l] = min(dp[l], dp[j] + a)

if dp[2**n-1] == INF:
    print(-1)
else:
    print(dp[2**n-1])
s = list(map(int,intput().split()))
s.sort()

print(s[len(s)-1] - s[0])

### FIXED CODE ###

n = int(input())
s = list(map(int,input().split()))
s.sort()

print(s[len(s)-1] - s[0])
# coding: utf-8

n, m, x, y = map(int, input().split())
xn = list(map(int, input().split())
ym = list(map(int, input().split())

if x < y:
    if max(xn) < min(ym):
        print("War")
else:
    print("No War")

### FIXED CODE ###

# coding: utf-8
 
n, m, x, y = map(int, input().split())
xn = list(map(int, input().split()))
ym = list(map(int, input().split()))
xn.append(x)
ym.append(y)
flag = 0

if max(xn) < min(ym):
    print("No War")
else:
    print("War")
a=input()
b=a**3+a**2+a
print(b)

### FIXED CODE ###

a = int(input())
b = a ** 3 + a ** 2 + a
print(b)
s = input()
L = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
res = ""
if len(s) < 26:
    for i in range(26):
        if L[i] in s:
            continue
        else:
            res += s + L[i]
            break
else:
    for i in range(1, 26):
        if s[i - 1] > s[i]:
            if L[L.index(s[i]) + 1] != s[i - 1]:
                continue
            else:
                res = s[: i - 1]
                res += L[res.index(res[-1]) + 1]
                break
    else:
        res ="-1"

print(res)

### FIXED CODE ###

def main():
    s = input()
    alphabet = "".join([chr(i) for i in range(97, 97 + 26)])
    if len(s) < 26:
        for i in alphabet:
            if i not in s:
                print(s + i)
                exit()
    else:
        if s == "zyxwvutsrqponmlkjihgfedcba":
            print(-1)
        else:
            for i in reversed(range(26)):
                for j in reversed(range(i + 1, 26)):
                    if s[i] < s[j]:
                        print(s[:i] + s[j])
                        exit()


if __name__ == '__main__':
    main()
A=[]
Y = []
for i in range(5):
    x = int(input())
    y = x % 10
    x = x + (10-y)
    A.append((y,x))

B = sorted(A):
sum = 0

for i in range(len(B)):
    x,y = B[i]
    sum += x
    if i == len(B)-1:
        sum -= y

print(sum)


### FIXED CODE ###

A=[]
Y=[]
for i in range(5):
    x = int(input())
    y = x % 10
    if y != 0:
        x = x + (10-y)
    A.append((y,x))

B = sorted(A)
sum = 0
flag = 0
#print(B)
for i in range(len(B)):
    y,x = B[i]
    sum += x
    if flag == 0:
        if y != 0:
            sum -= 10-y
            flag = 1

print(sum)
N, M, K = list(map(int, input().split()))
AB_list = []
for _ in range(M):
    A, B = sorted(list(map(int, input().split())))
    AB_list.append([A - 1, B - 1])
CD_list = []
for _ in range(K):
    C, D = sorted(list(map(int, input().split())))
    CD_list.append([C - 1, D - 1])

parents = [i for i in range(N)]

def root(x):
    if parents[x] == x:
        return x
    parents[x] = root(parents[x])
    return parents[x]

def unite(x, y):
    rx = root(x)
    ry = root(y)
    if rx != ry:
        parents[rx] = ry

def same(x, y):
    return root(x) == root(y)

for A, B in AB_list:
    unite(A, B)
for i in range(N):
    root(i)

answers = [0] * N
for i in range(N):
    may_friends = parents.count(root(i)) - 1
    friends = sum(1 for x, y in AB_list if x == i or y == i)
    blocks = sum(1 for x, y in CD_list if (x == i or y == i) and root(x) == root(y))
    answers[i] = may_friends - friends - blocks

print(" ".join(map(str, answers)))

### FIXED CODE ###

class UnionFind:
    def __init__(self, N):
        self.N = N
        self.parents = [i for i in range(N)]
        self.sizes = [1] * N

    def root(self, x):
        if self.parents[x] == x:
            return x
        self.parents[x] = self.root(self.parents[x])
        return self.parents[x]

    def unite(self, x, y):
        rx = self.root(x)
        ry = self.root(y)
        if rx < ry:
            self.parents[ry] = rx
            self.sizes[rx] += self.sizes[ry]
            self.sizes[ry] = 0
        elif rx > ry:
            self.parents[rx] = ry
            self.sizes[ry] += self.sizes[rx]
            self.sizes[rx] = 0

    def same(self, x, y):
        return self.root(x) == self.root(y)
    
    def size(self, x):
        return self.sizes[self.root(x)]

N, M, K = list(map(int, input().split()))
AB_list = []
for _ in range(M):
    A, B = list(map(int, input().split()))
    AB_list.append([A - 1, B - 1])
CD_list = []
for _ in range(K):
    C, D = list(map(int, input().split()))
    CD_list.append([C - 1, D - 1])

uf = UnionFind(N)
for A, B in AB_list:
    uf.unite(A, B)

friends = [0] * N
for A, B in AB_list:
    friends[A] += 1
    friends[B] += 1
blocks = [0] * N
for C, D in CD_list:
    if uf.root(C) != uf.root(D):
        continue
    blocks[C] += 1
    blocks[D] += 1
answers = [0] * N
for i in range(N):
    answers[i] = uf.size(i) - 1 - friends[i] - blocks[i]

print(" ".join(map(str, answers)))
coding:utf-8
import sys

H,W = raw_input().split()
a =[]
for line in range(int(H)):
    a.append(raw_input())

print a

for i in range(0,int(W)+2):
    sys.stdout.write("#")
print

for i in range(0,int(H)):
    sys.stdout.write("#")
    for j in range(0,int(W)):
        sys.stdout.write(a[i][j])
    sys.stdout.write("#")
    print

for i in range(0,int(W)+2):
    sys.stdout.write("#")
print

### FIXED CODE ###

import sys

H,W = raw_input().split()
a =[]
for line in range(int(H)):
    a.append(raw_input())

for i in range(0,int(W)+2):
    sys.stdout.write("#")
print

for i in range(0,int(H)):
    sys.stdout.write("#")
    for j in range(0,int(W)):
        sys.stdout.write(a[i][j])
    sys.stdout.write("#")
    print

for i in range(0,int(W)+2):
    sys.stdout.write("#")
print
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from math import factorial


def comb(n, r):
    nf = factorial(n)
    rf = factorial(r)
    nrf = factorial(n - r)
    return int(nf / (rf * nrf))


n, a, b = map(int, input().split())
goods = list(reversed(sorted([int(x) for x in input().split()])))

avg, total = sum(goods[:a]) / a, 0

lastcount, lastindex = 0, 0
for i, val in enumerate(goods):
    if val == goods[a - 1]:
        lastcount += 1
        if i < a:
            lastindex += 1

if a == 1 or goods[0] != goods[a - 1]:
    total += comb(lastcount, lastindex)
else:
    for i in range(a, b + 1):
        total += comb(lastcount, i)

print(avg)
print(total)


### FIXED CODE ###

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

from math import factorial


def comb(n, r):
    nf = factorial(n)
    rf = factorial(r)
    nrf = factorial(n - r)
    return int(nf / (rf * nrf))


n, a, b = map(int, input().split())
goods = list(reversed(sorted([int(x) for x in input().split()])))

avg, total = sum(goods[:a]) / a, 0

lastcount, lastindex = 0, 0
for i, val in enumerate(goods):
    if val == goods[a - 1]:
        lastcount += 1
        if i < a:
            lastindex += 1

if goods[0] != goods[a - 1]:
    total += comb(lastcount, lastindex)
else:
    for i in range(a - 1, b):
        if goods[a - 1] != goods[i]: break
        total += comb(lastcount, i + 1)

print("{}\n{}".format(avg, total))
import sys
sys.setrecursionlimit(3000)

a=open(0)
N,_,*a = map(int, a.read().split())

dp = [-1 for _ in range(150000)]
dp[0] = 0
def rec(i):
    if dp[i] >= 0:
        return dp[i]
    if i in a:
        dp[i] = 0
        return 0
    if i<3:
        dp[i] = rec(i-1) + 1
        return dp[i]
    dp[i] = (rec(i-1)+rec(i-2))%1000000007
    return dp[i]
    
print(rec(N))




### FIXED CODE ###

import sys

sys.setrecursionlimit(2147483647)
INF = float("inf")
MOD = 1000000007

a=open(0)
N,_,*a = map(int, a.read().split())

dp = [-1 for _ in range(100010)]
dp[0] = 0
for i in a: dp[i] = 0
def rec(i):
    if dp[i] > -1:
        return dp[i]
    if i<3:
        dp[i] = rec(i-1) + 1
        return dp[i]
    dp[i] = (rec(i-1)+rec(i-2))%MOD
    return dp[i]
    
print(rec(N))
N, M = map(int, input().split())
pair = {}
def root(x):
    if x == pair[x]:
        return x
    else:
        pair[x] = root(pair[x])
    return pair[x]

def unite(x, y):
    rx = root(x)
    ry = root(y)
    if rx == ry:
        return True
    else:
        pair[rx] = ry

def same(x, y):
    rx = root(x)
    ry = root(y)
    return rx == ry

for i in range(1, N+1):
    pair.setdefault(i, i)

for i in range(M):
    x, y, z = map(int, input().split())
    unite(x, y)

cnt = set()
for k, y in pair.items():
    ry = root(y)
    cnt.add(ry)
print(len(cnt))


### FIXED CODE ###

import sys

input = sys.stdin.readline
N, M = map(int, input().split())
pair = {}
rank = {}
def root(x):
    if x == pair[x]:
        return x
    else:
        pair[x] = root(pair[x])
    return pair[x]

def unite(x, y):
    rx = root(x)
    ry = root(y)
    if rx > ry:
        pair[rx] = pair[ry]
    else:
        pair[ry] = pair[rx]

for i in range(1, N+1):
    pair.setdefault(i, i)

for i in range(1, N+1):
    rank.setdefault(i, 0)

tmp = []
for i in range(M):
    tmp.append(list(map(int, input().split())))
tmp.sort()
for i in range(M):
    x, y = tmp[i][0], tmp[i][1]
    if x < y:
        unite(x, y)
    else:
        unite(y, x)

cnt = set()
for k, y in pair.items():
    y = root(y)
    cnt.add(y)
print(len(cnt))
def gcd(a,b):
    if(b==0): 
        return a 
    else: 
        return gcd(b,a%b)


n = int(input())
a = map(int,input().split())
a = list(map(int, a))
a1 = a
res = 0
count = 0
count1 = 0
for i in a:
    for j in a1:
        if count != count1 and gcd(i,j)>res:
            res = gcd(i,j)
        count1 = count1 + 1
    count = count + 1
    count1 = 0
print(res)

### FIXED CODE ###

a,b,t=map(int,input().split());print(int(t/a)*b)
import math
from functools import reduce

n = int(input())
a_list = list(map(int, input().split()))
prime_list = list(range(math.ceil(a_list[n - 1] ** 0.5)))

for i in range(2, prime_list[-1] + 1):
    if prime_list[i] != -1:
        index = i
        while index + i <= prime_list[-1]:
            index += i
            prime_list[index] = -1
prime_list.sort()
del prime_list[0: prime_list.index(1) + 1]
check_list = [0] * len(prime_list)

def is_pairwise(num):
    for i, prime in enumerate(prime_list):
        if num % prime == 0:
            if check_list[i] == 1:
                return False
            else:
                check_list[i] += 1
    return True

for a in a_list:
    if not is_pairwise(a):
        if reduce(math.gcd, a_list) == 1:
            print("setwise coprime")
            exit()
        else:
            print("not coprime")
            exit()
print("pairwise coprime")


### FIXED CODE ###

import math
from functools import reduce
L = 10**6 + 1
n = int(input())
a_list = list(map(int, input().split()))
memo = [0] * L

for a in a_list:
    memo[a] += 1

for i in range(2, L):
    if sum(memo[i::i]) > 1:
        if reduce(math.gcd, a_list) == 1:
            print("setwise coprime")
            exit()
        else:
            print("not coprime")
            exit()

print("pairwise coprime")
N, K = map(int, input().split())

d = []
l = []
i = 0

while i <= 2*K:
  i += 1
  if i % 2 == 1:
    d.append(int(input()))
  else:
    l.extend([int(x) for x in input().split()])

L = set(l)
print(K - len(L))

### FIXED CODE ###

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

d = []
l = []
i = 0

while i < 2*K:
  i += 1
  if i % 2 == 0:
    l.extend([int(x) for x in input().split()])
  else:
    d.append(int(input()))

L = list(set(l))
print(N - len(L))
s = str(input())
print str.lower(s)[:4] == "yaki"

### FIXED CODE ###

if str.lower(input())[:4] == "yaki":
  print("Yes")
else:
  print("No")
import sys
input = sys.stdin.readline

n, k = map(int, input().split())
a = list(map(int, input().split()))
l = 1
m = []

for i in range(10000):
    print(i)
    if a[l - 1] in m: #ループが始まったかどうか
        for j in range(len(m)):
            if m[j] == a[l - 1]:
                cnt = j #ループ開始までの端数
                loop = len(m) - cnt #ループの長さ
                break
    else:
        m.append(a[l - 1])
        l = a[l - 1]
        continue
    break


if (k - cnt)%loop == 0:
    l = loop + cnt - 1
else:
    l = (k - cnt)%loop - 1 + cnt

print(m[l])

### FIXED CODE ###

import sys
input = sys.stdin.readline

def main():
    n, k = map(int, input().split())
    a = list(map(int, input().split()))
    l = [-1]*n
    now = 0
    order = 0
    l[0] = 0
    s = {}
    ans = -100

    for i in range(n):
        a[i] -= 1

    while k > 0:
        k -= 1
        now = a[now]
        order += 1
        if l[now] != -1: #既に訪問済の場合
            loop = order - l[now]
            k %= loop
        if k == 0:
            ans = now + 1
            break
        l[now] = order #転送順で何番目の町かを記録

    print(max(ans, -1))

main()
N = int(input())

d_list = [1]

a = 1
while True;
  if 6**a <= N:
    d_list.append(6**a)
    a += 1
  else:
    break
a = 1
while True:
  if 9**a <= N:
    d_list.append(9**a)
    a += 1
  else:
    break
d_list.sort(key=lambda x:-x)

rest = N
cnt = 0
while True:
  if rest < 6:
    cnt = rest
    print(cnt)
  else:
    for num in d_list:
      if rest >= num:
        cnt += 1
        rest -= num
        break


### FIXED CODE ###

N = int(input())
INF = 10**6
dp = [INF] * (max(9, N)+1)
dp[0] = 0
for i in range(N):
  n = m = 0
  while i+9**n <= N:
    dp[i+9**n] = min(dp[i+9**n], dp[i] + 1)
    n += 1
  while i+6**m <= N:
    dp[i+6**m] = min(dp[i+6**m], dp[i] + 1)
    m += 1
print(dp[N])
A=[]
B=[]
a=0
x=0
for c in input():
 if"\\"==c:A+=[x]
 elif"/"==c and A:
  j=A.pop()
  t=x-j
  a+=t
  while B and B[-1][0]>j:t+=B[-1][1];B.pop()
  B+=[(j,t)]
 x+=1
print(a)
if p:print(len(B),*list(zip(*B))[1])
else:print(0)


### FIXED CODE ###

A=[]
B=[]
a=0
i=0
for c in input():
 if"\\"==c:
  A+=[i]
 elif"/"==c and A:
  j=A.pop()
  t=i-j
  a+=t
  while B and B[-1][0]>j:
   t+=B[-1][1];B.pop()
  B+=[(j,t)]
 i+=1
print(a)
if B:
 print(len(B),*list(zip(*B))[1])
else:
 print(0)
N = int(input())
hotel = list(map(int,input().split()))
new =[]

count = 0
for i in hotel:
  new.append(hotel(i))
  if hotel(i) == max(new):
    count += 1
print(count)

### FIXED CODE ###

N = int(input())
hotel = list(map(int,input().split()))
new =[]

count = 0
for i in hotel:
  new.append(i)
  if i == max(new):
    count += 1
print(count)
A = int(input())
B = int(input())
print(A*B)


### FIXED CODE ###

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