Harryxun/stf_run huggingface dataset:
import sys
ANS = []
N, M = map(int, input().split())
for j in range(N):
  ANS.append(0)
for i in range(M):
  s, c = map(int, input().split())
  ANS[s-1] = c
 
if ANS[0] == 0:
  print(-1)
  sys.exit()
 
NEW = 0
for i in range(1,N):
  NEW += ANS[-i] * (10**(i))
 
print(NEW)

### FIXED CODE ###

N = int(input())
print(int((N+1)/2))
N,M = map( int, input().split() )
break_list = []
for i in range(M):
    break_list.append( int( input() ) )
   
fib = [0] * (N + 1)
if 1 in break_list:
    fib[1] = 0
else:
    fib[1] = 1
    
fib[0] = 1
for i in range(N - 1):
	if i + 2 in break_list:
    	fib[i + 2] = 0
    else:
        fib[i + 2] = fib[i] + fib[i + 1]

if N == 1:
  print( fib[1] )
else:
  print( fib[i+2] %  1000000007 )


### FIXED CODE ###

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

break_list.append(-10)
t = 0
fib = [0] * (N + 1)
if break_list[0] == 1:
    fib[1] = 0
    t += 1
else:
    fib[1] = 1
    
fib[0] = 1

for i in range(N - 1):
    if ( i + 2 ) ==  break_list[t]:
        fib[i + 2] = 0
        t += 1
    else:
        fib[i + 2] = fib[i] + fib[i + 1]
 
if N == 1:
    print( fib[1] )
else:
    print( fib[i+2] %  1000000007 )
x, t = list(map(int,input().split())
if x < t:
	print("0")
else:
	print(x-t)

### FIXED CODE ###

x, t = list(map(int,input().split()))
if x < t:
	print("0")
else:
	print(x-t)
import itertools
import math
from collections import deque
from collections import defaultdict
from itertools import permutations
import heapq
import bisect
from scipy.sparse.csgraph import floyd_warshall as wf
from collections import Counter
from itertools import*
from bisect import bisect_left,bisect_right
inf = 10**10
def gcd(a, b):
	while b:
		a, b = b, a % b
	return a
def gcd_list(numbers):
    return reduce(gcd,numbers)
def lcm(a,b):
  return a*b //gcd(a,b)
n,m = map(int,input().split())
s = input()
t = input()
d = gcd(n,m)
l = lcm(n,m)
a = n//d 
b = m//d 
for i in range(d):
    if s[a*i]!= t[b*i]:
        print(-1)
        break
    else:
        print(l)

### FIXED CODE ###

N,M = map(int,input().split())
S = input()
T = input()
#良い文字列は存在するならば長さはN,Mの最小公倍数になる
#異なる文字が同じ場所に来たらダメ
def gcd(a, b):
	while b:
		a, b = b, a % b
	return a
def lcm(a,b):
  return a*b //gcd(a,b)
L = lcm(N,M)
n = N//gcd(N,M)
m = M//gcd(N,M)
for k in range(gcd(N,M)):
    if S[k*n] != T[k*m]:
        print(-1)
        exit()
print(L)
a_list =[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]
K = int(input())
print(a_list[K+1])

### FIXED CODE ###

a_list =[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]
K = int(input())
print(a_list[K-1])
import numpy as np

### FIXED CODE ###

# coding=utf-8
from __future__ import division
from  math import sqrt


def main():
    n = input()
    while n:
        scores = map(int, raw_input().split())
        m = sum(scores) / n
        print sqrt(sum([(x - m) ** 2 for x in scores]) / n)
        n = input()


if __name__ == '__main__':
    main()
n = int(input())
li = []
for i in range(n):li.append(int(input())
if sum(li) % 10 == 0:print("0")
else:print(sum(li))

### FIXED CODE ###

n = int(input())
li = []
for i in range(n):li.append(int(input()))
li.sort()
if sum(li) % 10 == 0:
    for k in range(n):
        if (sum(li)-li[k]) % 10 != 0:
            print(sum(li)-li[k])
            exit()
else:
    print(sum(li))
    exit()
print("0")
n=int(input())
l=list(map(int,input().split()))
res=0
if n<=2 :
  print(0)
else:
	for i in range(n):
  		for j in range(i,n):
    		for k in range(j,n):
      			if l[i]!=l[j] and l[j]!=l[k] and (l[i]+l[j]>l[k]) and (l[i]+l[k]>l[j]) and (l[j]+l[k]>l[i]):
        		res+=1
print(res)

### FIXED CODE ###

n=int(input())
l=list(map(int,input().split()))
res=0
if n<=2:
	print(0)
else:
	for i in range(n):
		for j in range(i,n):
			for k in range(j,n):
				if (l[i]!=l[j]) and (l[j]!=l[k]) and (l[i]!=l[k]) and (l[i]+l[j]>l[k]) and (l[j]+l[k]>l[i]) and (l[k]+l[i]>l[j]):
					#print(l[i],l[j],l[k])
					res+=1
	print(res)
n, k = map(int, input().split())
s = input()
if n == 1:
    print(1)
if n != 1:
    nums = []
    cnt = 1
    for i in range(1, n):
        if s[i - 1] != s[i]:
            nums.append([s[i - 1], cnt])
            cnt = 1
            if i == n - 1:
                nums.append([s[i], cnt])
        else:
            cnt += 1
            if i == n - 1:
                nums.append([s[i - 1], cnt])

    candi = 0
    ansli = []
    p = 0
    for i in range(len(nums)):
        if nums[i][0] == "0":
            p += 1
    k = min(k, p)

    i1 = 0
    j1 = 0
    while i1 <= k:
        if i1 == k and nums[j1][0] == "0":
            pass
        else:
            candi += nums[j1][1]
        if nums[j1][0] == "0":
            i1 += 1
        j1 += 1
    ansli.append(candi)

    a = 0
    b = j1 - 1
    while b < len(nums):
        for i in range(2):
            if nums[a + i][0] == "1":
                candi -= nums[a + i][1]
            elif nums[a + i][0] == "0":
                candi -= nums[a + i][1]
                a += i + 1
                break
        for i in range(2):
            if b + i >= len(nums):
                ansli.append(candi)
                b += 1
                break
            else:
                if nums[b + i][0] == "1":
                    candi += nums[b + i][1]
                    b += i + 1
                    ansli.append(candi)
                    break
                elif nums[b + i][0] == "0":
                    candi += nums[b + i][1]

    print(max(ansli))

### FIXED CODE ###

n, k = map(int, input().split())
s = input()
if n == 1:
    print(1)
if n != 1:
    nums = []
    cnt = 1
    for i in range(1, n):
        if s[i - 1] != s[i]:
            nums.append([s[i - 1], cnt])
            cnt = 1
            if i == n - 1:
                nums.append([s[i], cnt])
        else:
            cnt += 1
            if i == n - 1:
                nums.append([s[i - 1], cnt])

    candi = 0
    ansli = []
    p = 0
    for i in range(len(nums)):
        if nums[i][0] == "0":
            p += 1
    k = min(k, p)

    i1 = 0
    j1 = 0
    while i1 <= k and j1 < len(nums):
        if i1 == k and nums[j1][0] == "0":
            pass
        else:
            candi += nums[j1][1]
        if nums[j1][0] == "0":
            i1 += 1
        j1 += 1
    ansli.append(candi)
    if candi == n:
        print(n)
        exit()

    a = 0
    b = j1 - 1
    while b < len(nums):
        for i in range(2):
            if nums[a + i][0] == "1":
                candi -= nums[a + i][1]
            elif nums[a + i][0] == "0":
                candi -= nums[a + i][1]
                a += i + 1
                break
        for i in range(2):
            if b + i >= len(nums):
                ansli.append(candi)
                b += 1
                break
            else:
                if nums[b + i][0] == "1":
                    candi += nums[b + i][1]
                    b += i + 1
                    ansli.append(candi)
                    break
                elif nums[b + i][0] == "0":
                    candi += nums[b + i][1]

    print(max(ansli))
r, g, b = list(map(int, input()))
a = r*100+g*10+b

if a % 4 == 0:
    print('Yes')
else:
    print('No')


### FIXED CODE ###


r, g, b = list(map(int, input().split()))
a = r*100+g*10+b

if a % 4 == 0:
    print('YES')
else:
    print('NO')
n,k=map(int,input().split())
a=list(map(lambda x:int(x)-1,input().split()))
lst=[0]
now=0
memo=0
town=[0]*n
town[0]=1
b=0 #フラグ
for i in range(k):
  now=a[now]#今どこにいるか
  if town[now]==1:#きたことがあるなら1
    memo=now #どこからループが始まるか覚えておく
    b=1
    break
  lst.append(now)
  town[now]=1
if b==1:
  i=lst.index(now)　
  l=len(lst)
  if memo!=0:
    lst=lst[i:]
    l-=len(lst)
    print(lst[(k-l)%len(lst)]+1)


### FIXED CODE ###

n,k=map(int,input().split())
a=list(map(lambda x:int(x)-1,input().split()))
lst=[0]
now=0
memo=0
town=[0]*n
town[0]=1
b=0
for i in range(k):
	now=a[now]
	if town[now]==1:
		memo=now
		b=1
		break
	lst.append(now)
	town[now]=1
if b==1:
	i=lst.index(memo)
	l=len(lst)
	if memo!=0:
		lst=lst[i:]
		l-=len(lst)
		print(lst[(k-l)%len(lst)]+1)
	else:
		print(lst[k%l]+1)
else:
	print(now+1)
s = input()
k = int(input())

if k <= len(s):
  print(s[k-1])
elif s[:k] == '1'*k:
  print(1)
else:
  print(s.translate(str.maketrans('','','1'))[0])
  

### FIXED CODE ###

s = list(map(int,list(input())))
k = int(input())

a = 0
i = 0

while a < k:
  a += min(s[i]**70, k)
  i +=1

print(s[i-1])
S = input()
num = len(S)

pair = 0

if num < 5:
    print(0)
else:
    for i in range(5,num):
        for j in range(num-i+1):
            temp = int(S[j:j+i+1])
            if temp % 2019 == 0:
                pair += 1

    print(pair)


### FIXED CODE ###

S,W = map(int, input().split())

if W>=S:
    print('unsafe')
else:
    print('safe')
a, b = map(int, input().split())
num=a*b
if num%2==0:
    print("Even")
else:
    print("Odd")

### FIXED CODE ###

a, b = map(int, input().split())
num=a*b
if num%2==0:
    print("Even")
else:
    print("Odd")
N = int(input())
A = list(map(int,input().split()))
S = []
P = A[:N]
Q = A[2*N:]
for i in range(N):
    Q[i] *= -1
R = A[N:2*N]
p = [0]*(N+1)
q = [0]*(N+1)
import heapq
heapq.heapify(P)
heapq.heapify(Q)
sp = sum(P)
sq = sum(Q)
p[0] = sp
q[0] = sq

for i in range(1,N+1):
    heapq.heappush(P,R[i-1])
    heapq.heappop(P)
    sp = sum(P)
    p[i] = sum(Q)
for i in range(1,N+1):
    heapq.heappush(Q,-R[-i])
    heapq.heappop(Q)
    sq = sum(Q)
    q[i] = sq

ans = -(10**100)
for k in range(N+1):
    ans = max(ans,p[k] + q[N-k])
    
print(ans)


### FIXED CODE ###

W,H = map(int,input().split())
ans = 10**30
for i in range(1,W):
    a = H*i
    w = W - i
    b = max((w//2)*H,w*(H//2))
    c = w*H - b
    x = max(a,b,c) - min(a,b,c)
    ans = min(ans,x)
for i in range(1,H):
    a = W*i
    h = H - i
    b = max((W//2)*h,W*(h//2))
    c = h*W - b
    x = max(a,b,c) - min(a,b,c)
    ans = min(ans,x)
print(ans)
import numpy as np
from numba import njit

n, k = map(int, input().split())
a = tuple(map(int, input().split()))

dp = np.zeros((n + 1, k), bool)
dp[0][0] = True
for i, e in enumerate(a, 1):
    dp[i] = dp[i-1]
    dp[i, e:] |= dp[i-1, :-e]

dp2 = np.zeros((n + 1, k), bool)
dp2[0][0] = True
for i, e in enumerate(a[::-1], 1):
    dp2[i] = dp2[i-1]
    dp2[i, e:] |= dp2[i-1, :-e]


@njit
def f(a, dp, dp2):
    ret = 0
    for i, e in enumerate(a, 1):
        li = [j for j in range(k) if dp[i-1][j]]
        li2 = [j for j in range(k) if dp2[n-i][j]]

        j = len(li2) - 1
        mx = 0
        for e2 in li:
            while j > 0 and e2 + li2[j] >= k:
                j -= 1

            if e2 + li2[j] < k:
                mx = max(mx, e2 + li2[j])

        if mx + e < k:
            ret += 1

    return ret


ans = f(a, dp, dp2)
print(ans)


### FIXED CODE ###

import numpy as np


def check(x):
    dp = np.zeros(k, np.bool)
    dp[0] = True
    for e in a[:x] + a[x+1:]:
        dp[e:] |= dp[:-e]

    return dp[-a[x]:].any()


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

a.sort()

lb = -1
ub = n
while ub - lb > 1:
    m = (lb + ub) // 2
    if check(m):
        ub = m
    else:
        lb = m

print(ub)
n = int(n)
a = input().split()
b = input().split()
c = input().split()
a = [int(i) for i in a]
b = [int(i) for i in b]
c = [int(i) for i in c]

d = 0
for i in b:
  d += i

for i in range(n):
  if i + 1 < n:
    if a[i] +1  == a[i+1]:
      d += c[i-1]
  
print(d)

### FIXED CODE ###

n = input()
n = int(n)
a = input().split()
b = input().split()
c = input().split()
a = [int(i) for i in a]
b = [int(i) for i in b]
c = [int(i) for i in c]

d = 0
for i in b:
  d += i

for i in range(n):
  if i + 1 < n:
    if a[i] +1  == a[i+1]:
      p = a[i]-1
      d += c[p]
  
print(d)
T1, T2 = map(int, input().split())
A1, A2 = map(int, input().split())
B1, B2 = map(int, input().split())

d1 = T1*(A1-B1)
d2 = T2*(A2-B2)
if d1>d2:
    d1 *= -1
    d2 *= -1

if (d1>0 and d1+d2>0) or (d1<0 and d1+d2<0):
    print(0)
elif d1+d2==0:
    print("infinity")
else:
    v = (abs(d1)//(d1+d2))
    ans = v*2
    pos = d1+v*(d1+d2)
    if pos<0 and pos+d2>=0:
        ans += 1
    print(pos)

### FIXED CODE ###

from operator import add


class SegTree():
    def __init__(self, N, e, operator_func=add):
        self.e = e # 単位元
        self.size = N
        self.node = [self.e] * (2*N)
        self.operator_func = operator_func # 処理(add or xor max minなど)

    def set_list(self, l):
        for i in range(self.size):
            self.node[i+self.size-1] = l[i]
        for i in range(self.size-1)[::-1]:
            self.node[i] = self.operator_func(self.node[2*i+1], self.node[2*i+2])
    
    def update(self, k, x):
        k += self.size-1
        self.node[k] = x
        while k >= 0:
            k = (k - 1) // 2
            self.node[k] = self.operator_func(self.node[2*k+1], self.node[2*k+2])

    def get(self, l, r):
        # [l, r) についてqueryを求める
        x = self.e
        l += self.size
        r += self.size

        while l<r:
            if l&1:
                x = self.operator_func(x, self.node[l-1])
                l += 1
            if r&1:
                r -= 1
                x = self.operator_func(x, self.node[r-1])
            l >>= 1
            r >>= 1
        return x


N, K = map(int, input().split())
*P, = map(int, input().split())
INF = 10**12

tree_max = SegTree(N, -INF, operator_func=max)
tree_max.set_list(P)
tree_min = SegTree(N, INF, operator_func=min)
tree_min.set_list(P)
tree_monoinc = SegTree(N, INF, operator_func=min)
for i in range(N):
    tree_monoinc.update(i, P[i]-P[i-1] if i else 0)

def isMonoinc(l, r):
    # [l, r)
    l += 1
    return tree_monoinc.get(l, r)>=0

ans = N-K+1
orig = 0

for i in range(N-K+1):
    if isMonoinc(i, i+K):
        orig = 1
        ans -= 1
    elif i+K<N and tree_max.get(i, i+K+1)==P[i+K] and tree_min.get(i, i+K+1)==P[i]:
        ans -= 1

ans += orig
print(ans)
h,w = map(int,input().split())
a = []
for i in range(h):
  a.append(input())
for i in range(h):
  for j in range(w):
    if i !=0:
      if a[i][j] != a[i-1][j]:
        print("No")
        quit()
    if j !=0:
      if a[i][j] != a[i][j-1]:
        print("No")
        quit()
    if i !=h:
      if a[i][j] != a[i+1][j]:
        print("No")
        quit()
    if j !=w:
      if a[i][j] != a[i][j+1]:
        print("No")
        quit()
print("Yes")

### FIXED CODE ###

h,w=map(int,input().split())
lis = []
for _ in range(h):
 lis.append(input())
for i in range(h):
 for j in range(w):
  if lis[i][j] == "#":
    if (i == 0 or lis[i-1][j] == ".") and (j==0 or lis[i][j-1] == ".")  and (i == h-1 or lis[i+1][j] == ".") and (j == w-1 or lis[i][j+1] == "."):
      print("No")
      quit()
print("Yes")
import sys
import numpy as np
from numpy.linalg import solve
n = int(input())
a = list(map(int,input().split()))

left = np.zeros((n, n))

for i in range(n):
  left[i][i] +=1
  if i == n-1:
    left[i][0] += 1
  else:
    left[i][i+1] +=1

tmparr = solve(left, a)

tmparr = [int(tmparr[i]*2) for i in range(n)]

print(' '.join(map(str, tmparr)))

### FIXED CODE ###

n = int(input())
dam = list(map(int,input().split()))
mountain =[0]*n
all_water = sum(dam)
def dam_water(num):
  sum_dam = 0
  for i in range(num,n,2):
    sum_dam += dam[i]
  return sum_dam

mountain[0] = all_water - 2 * (dam_water(1))

for i in range(1,n):
  mountain[i] = 2*dam[i-1] - mountain[i-1]

print(" ".join(map(str,mountain)))
from itertools import combinations_with_replacement


n,m,q = map(int,input().split())
num_lst = []
for i in range(q):
    num_lst.append(list(map(int,input().split())))
l = list(range(1,m+1))
A = list(combinations_with_replacement(l,n))

mx = 0
for now_A in A:
    score = 0
    for nums in num_lst:
        a,b,c,d = nums
        if now_A[b-1] - now_A[a-1] == c:
            score += d
    mx = max(mx,score)
print(mx)





### FIXED CODE ###

#import matplotlib.pyplot as plt

def main():
    a,b,n = map(int,input().split())
    x = min(b-1,n)



    print(int(a*x/b) - a * int(x/b))


    #plt.plot(list(range(len(right))),right,label="test")


if __name__ == '__main__':
    main()
a = list(input())
a[3] = '8'
print("".join.(a))


### FIXED CODE ###

a = list(input())
a[3] = '8'
print("".join(a))
n,k=map(int,input().split())
a=list(map(int,input().split()))
a=sorted(a,reverse=True)
mod=10**9+7
x=1
y=0
z=n-1
if k%2 == 1:
  q = k//2
  a0 = a[0]
  L = a[x]*a[x+1]
  R = a[z]*a[z-1]
  if L>R:
    for i in range(q):
      a0 *= L
      x += 2
      print(a0%mod)
  else:
    for i in range(q):
      a0 *= R
      z -= 2
      print(a0%mod)
      
else:
  q = k/2
  one = 1
  L = a[y]*a[y+1]
  R = a[z]*a[z-1]
  if L>R:
    for i in range(q):
      one *= L
      y += 2
      print(one%mod)
  else:
    for i in range(q):
      one *= R
      z -=2
      print(one%mod)
      
  
    
    

### FIXED CODE ###

import sys
 
n, k = map(int, input().split())
a = [int(x) for x in input().split()]
mod = pow(10, 9)+7
zero = 0
plus = []
minus = []
for i in range(n):
  if a[i] == 0:
    zero += 1
  elif a[i] > 0:
    plus.append(a[i])
  else:
    minus.append(a[i])
 
P, M = len(plus), len(minus)
plus.sort(reverse=True)
minus.sort()
ans = 1
if n == k:
  for i in range(n):
    ans *= a[i]
    ans %= mod
elif P+M < k:
  ans = 0
elif P == 0:
  if zero and k%2:
    ans = 0
  else:
    if k%2:
      minus.reverse()
    for i in range(k):
      ans *= minus[i]
      ans %= mod
else:
  q = 0
  if k%2:
    ans *= plus[0]
    ans %= mod
    q = 1
  judge = []
  for i in range((len(plus)-q)//2):
    judge.append(plus[2*i+q]*plus[2*i+q+1])
  for i in range(len(minus)//2):
    judge.append(minus[2*i]*minus[2*i+1])
  judge.sort(reverse=True)
  for i in range(k//2):
    ans *= (judge[i]%mod)
    ans %= mod
 
print(ans)
A, B = map(int, input().split())
if (A+B)%2 != 0:
    print((A+B)//2)
else:
    print("IMPOSSIBLE)

### FIXED CODE ###

A, B = map(int, input().split())
if (A+B)%2 == 0:
    print((A+B)//2)
else:
    print("IMPOSSIBLE")
def ch(x):
    if x in ["+", "-", "*"]:
        return x
    else:
        return int(x)

def check(x):
    if (type(x[0]) is int) and (type(x[1]) is int) and (type(x[2]) is str):
        return True
    else:
        return False

def calc(x):
    if x[2] == "+":
        return x[0] + x[1]
    elif x[2] == "-":
        return x[0] - x[1]
    elif x[2] == "*":
        return x[0] * x[1]

N = list(map(ch, input().split()))

st = []
while True:
    if len(N) == 0:
        break
    elif len(st) in [0,1]:
        st.append(calc(N[:3]))
        N.pop(0); N.pop(0); N.pop(0);
    elif len(st) == 2:
        st.append(calc(st+[N[0]]))
        N.pop(0); st.pop(0); st.pop(0);
print(*st)
        



### FIXED CODE ###

def ch(x):
    if x in ["+", "-", "*"]:
        return x
    else:
        return int(x)

def calc(x):
    if x[2] == "+":
        return x[0] + x[1]
    elif x[2] == "-":
        return x[0] - x[1]
    elif x[2] == "*":
        return x[0] * x[1]

N = list(map(ch, input().split()))

st = []

while True:
    if len(N) == 0:
        break
    elif (type(N[0]) is int):
        st.append(N[0])
        N.pop(0)
    elif (type(N[0]) is str):
        st[-2] = calc([st[-2],st[-1],N[0]])
        st.pop(-1)
        N.pop(0)
print(*st)
a, b = map(int, input().split())
#print(a,b)
c = []
if (b-a) >= 2030:
    print(0)
else:
    for i in range(a,b):
        for j in range(i+1,b+1):
            c.append((i*j)%2019)
#print(c)
print(min(c))


### FIXED CODE ###

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

if b-a >= 2019:
    print(0)
else:
    c = []
    for i in range(a,b):
        for j in range(i+1,b+1):
            c.append(i*j % 2019)
    #print(c)
    print(min(c))
from sys import stdin
input=stdin.readline
input()
a=list(map(int,input().split()))
ans=sum(a)
b=[0]*(10**5)
for i in a:
  b[i]+=1
c=int(input())
for i in range(c):
  n,m=map(int,input().split())
  if b[n]>0:
    x=b[n]
    if x>0:
      b[m]+=x
      b[n]=0
      ans+=(m-n)*x
  print(ans)

### FIXED CODE ###

from sys import stdin
input=stdin.readline
input()
a=list(map(int,input().split()))
ans=sum(a)
b=[0]*(10**5+1)
for i in a:
  b[i]+=1
c=int(input())
for i in range(c):
  n,m=map(int,input().split())
  if b[n]>0:
    x=b[n]
    if x>0:
      b[m]+=x
      b[n]=0
      ans+=(m-n)*x
  print(ans)
n=int(input())
l = [*map(int, input().split())]
res = 0
for i in range(1,n-1):
  if l[i-1]<l[i]<l[i+1] or l[i-1]>l[i]>l[i+1]: res+=1
print(res)
    

### FIXED CODE ###

n=int(input())
l = list(map(int, input().split()))
res = 0
for i in range(1,n-1):
  if l[i-1]<l[i] and l[i]<l[i+1] or l[i-1]>l[i] and l[i]>l[i+1]: res+=1
print(res)
import sys
sys.setrecursionlimit(10 ** 6)
n,k = map(int,input().split())
li = [[] for _ in range(n+1)]
mod = 10**9+7
ans = k
perm = [1]*(n)# 組み合わせ(k-2)P(要素)

for i in range(n-1):
    a,b = map(int,input().split())
    li[a].append(b)
    li[b].append(a)
    perm[i+1] = (perm[i]*(k-2-i))%mod

def dfs(now,before):
    point = 1
    ret = 1
    if now == 1:
        ko = len(li[1])
        for i in range(ko):
            ret *= k-1-i
            ret %= mod
    else:
        ko = len(li[now])-1
        ret= perm[ko]%mod
    
    for i in li[now]:
        if i==before:
            continue
        ret = ret*dfs(i,a)%mod
    return ret

ans *= dfs(1,0)
print(ans)


### FIXED CODE ###

import sys
sys.setrecursionlimit(10**7)
n,k = map(int,input().split())
li = [[] for _ in range(n+1)]
mod = 10**9+7
ans = k
perm = [1]*(n)# 組み合わせ(k-2)P(要素)

for i in range(n-1):
    a,b = map(int,input().split())
    li[a].append(b)
    li[b].append(a)
    perm[i+1] = (perm[i]*(k-2-i))%mod

def dfs(now,before):
    point = 1
    if now == 1:
        ret = 1
        ko = len(li[1])
        for i in range(ko):
            ret *= k-1-i
            ret %= mod
    else:
        ko = len(li[now])-1
        ret= perm[ko]%mod
    
    for i in li[now]:
        if i==before:
            continue
        ret = ret*dfs(i,now)%mod
    return ret

ans *= dfs(1,0)

print(ans%mod)
import numpy as np
from scipy.sparse import csr_matrix
from scipy.sparse.csgraph import dijkstra

N, M = map(int, input().split())
edge_d = np.array([input().split() for _ in range(M)], dtype=np.int32)
edge_n = np.vstack([np.arange(2, N + 1, dtype=np.int16),
                   np.arange(1, N, dtype=np.int16),
                   np.ones(N - 1, dtype=np.int8)]).T
edge = np.concatenate([edge_d, edge_d[:, [1, 0, 2]], edge_n]).T

matr = csr_matrix((edge[2], (edge[:2] - 1)), (N, N))
ans = dijkstra(matr, indices=0)[-1]
if ans == np.inf:
    ans = 0
print(int(ans) - 1)


### FIXED CODE ###

import sys
from collections import defaultdict
import networkx as nx

input = sys.stdin.buffer.readline

N, M = map(int, input().split())
LR_dict = defaultdict(lambda: 10 ** 9)
for _ in range(M):
    l, r, c = map(int, input().split())
    LR_dict[(l, r)] = min(LR_dict[(l, r)], c)

G = nx.DiGraph()
G.add_nodes_from(range(1, N + 1))
G.add_weighted_edges_from([(x + 1, x, 0) for x in range(1, N)])
G.add_weighted_edges_from((l, r, c) for (l, r), c in LR_dict.items())

try:
    print(nx.dijkstra_path_length(G, 1, N))
except nx.NetworkXNoPath:
    print(-1)
A,B = map(int, input().split())

A_B = (A+B)

if A_B < 10:
    print(A_B)
elif A_B > 10:
    print("error")
elif A_B = 10:
    print("error")


### FIXED CODE ###

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

A_B = (A+B)

if A_B >= 10:
    print("error")
else:
    print(A_B)
def main():
    a, b = input().split()
    cnt = 1
    a = int(a)
    a1 = a
    while True:
        if a % 10 == 0:
            a /= 10
            cnt += 1
        else:
            break

    if cnt >= 2:
        b = float(b)
        #print(a, b, a*b)
        ans = int(a * b * 100) * (10 ** (cnt-2))
        print(ans)
    else:
        print(int(a1 * b))



if __name__ == "__main__":
    main()


### FIXED CODE ###

from decimal import *

def main():
    a, b = input().split()
    a = Decimal(a)
    b = Decimal(b)
    print(int(a * b))





if __name__ == "__main__":
    main()