peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
a, b = map(int, input().split())

import math
ans = math.ceil((b-1)/(a-1))
print(ans)
# Judge status: Wrong Answer
n = int(input())
a = list((int(x) for x in input().split()))
for num in a:
  if num%2 == 0:
    if not num%3 == 0 and num%5 == 0:
      print('DENIED')
      exit()
print('APPROVED')
# Judge status: Accepted
S=input()

count=0
if len(S)%2==0:
    for i in range(len(S)//2):
        if S[i]!=S[-i-1]:
            count+=1
else:
    for i in range((len(S)-1)//2):
        if S[i]!=S[-i-1]:
            count+=1

print(count)
# Judge status: Accepted
n = int(input())
a = list(map(int,input().split()))
count2 = -1
count4 = 0
for i in range(n):
    if a[i] % 4 == 2:
        count2 += 1
    if a[i] % 4 == 0:
        count4 += 1
if count2 >= 1:
    n -= count2
if count4 * 2 + 1 >= n:
    print("Yes")
    exit()
print("No")
# Judge status: Wrong Answer
def main():
    X = input()
    count = 0
    for i in range(4*10**2):
        count += X.count("ST")
        X = X.replace("ST","")
    print(len(X))


if __name__ == '__main__':
    main()
# Judge status: Accepted
from collections import defaultdict

def main():
    N = int(input())
    s = defaultdict(int)
    ans = 0
    for i in range(N):
        a = "".join(sorted(input()))
        s[a] += 1
        if s[a] != 1:
            ans += (s[a]-1)
    print(ans)

if __name__ == '__main__':
    main()
# Judge status: Accepted
w, h, n = map(int, input().split())
r_w = w
l_w = 0
u_h = h
d_h = 0

for i in range(n):
    x, y, a = map(int, input().split())
    if a == 1:
        l_w = max(l_w, x)
    elif a == 2:
        r_w = min(r_w, x)
    elif a == 3:
        d_h = max(d_h, y)
    elif a == 4:
        u_h = min(u_h, y)

res = max(0, r_w - l_w) * max(0, u_h - d_h)
print(res)
# Judge status: Accepted
S = input()

if (S[0]== "a" or S[1] == "a" or S[2] == "a") and (S[0]== "b" or S[1] == "b" or S[2] == "b") and (S[0] == "c" or S[1] == "c" or S[2] == "c") :
	print("Yes")
else:
	print("No")
# Judge status: Accepted
a=input()
for i in range(8):
    s=int(a[0])
    ans=[a[0]]
    for j in range(3):
        if (i>>j)&1:
            s+=int(a[j+1])
            ans+=["+"]+[a[j+1]]
        else:
            s-=int(a[j+1])
            ans+=["-"]+[a[j+1]]
    if s==7:
        print(*ans,sep="",end="")
        print("=7")
        break
# Judge status: Wrong Answer
h = int(input())
k = h // 2
if k == 0:
    print(1)
else:
    print(2**k + 2*k - 1)
# Judge status: Accepted
N, K = map(int, input().split())
H = list(map(int,input().split()))
sum = 0
i = K;
H.sort(reverse=True)

if(K >= len(H)):
    print(0)
else:
    for i in range(i, len(H)):
        sum += H[i];
    print(sum)
# Judge status: Accepted
import sys
def input(): return sys.stdin.readline().rstrip()

def main():
    n = int(input())
    sp = [input().split() + [i+1] for i in range(n)]
    sp = sorted(sp, key=lambda x: (x[0], -int(x[1])))
    for _, _, i in sp:
        print(i)

if __name__ == '__main__':
    main()
# Judge status: Accepted
a, b, x = map(int,  input().split())

ans = (b // x) - (a // x)

if a % x == 0:
    ans +=1

print(ans)
# Judge status: Accepted
N, K = map(int, input().split())
S = input()
assert len(S) == N
first = S[0]
target = "R" if first == "L" else "L"


def count_unhappy():
    tcnt = 0
    consecutive = False
    for c in S:
        if c == target:
            consecutive = True
        elif consecutive:
            tcnt += 1
            consecutive = False
    if consecutive:
        tcnt += 1
    unhappy = 2 * tcnt + (0 if S[-1] == target else 1)
    return max(unhappy - 2 * K, 1)


print(N - count_unhappy())
# Judge status: Accepted
A,B,C = map(int,input().split())

def F(A,B,C):
    if any(x&1 for x in [A,B,C]):
        return 0
    if A == B == C:
        return -1
    return 1 + F((A+B)//2,(B+C)//2,(C+A)//2)

answer = F(A,B,C)
print(answer)
# Judge status: Accepted
n = int(input())
p = []
m = []
for i in range(n):
    x, y = map(int, input().split())
    p.append(x+y)
    m.append(x-y)
p.sort()
m.sort()
print(max(p[-1]-p[0], m[-1]-m[0]))
# Judge status: Wrong Answer
*s, t = map(int, input().split())
s.sort()
for i in range(s[0],s[1]+1):
  if i == t:
    print("Yes")
print("No")
# Judge status: Accepted
a, b, c, d = map(int,input().split())


if -(-c // b) <= -(-a // d):
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
s = input()
n = len(s)
a = [0]*(n+1)
for i in range(n):
    if s[i] == '<':
        a[i+1] = a[i] + 1
for i in range(-1, -n, -1):
    if s[i] == '>':
        a[i-1] = max(a[i] + 1, a[i-1])
print(sum(a))
# Judge status: Wrong Answer
import math
s = input()
t = s[::-1]
print(s,t)
count = 0
for i in range(len(s)):
  if s[i] != t[i]:
    count += 1
print(math.ceil(count/2))
# Judge status: Accepted
n = input()
if n[0] == n[1] == n[2] or n[3] == n[1] == n[2]:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
n,*a=map(int,open(0).read().split())
b=[0]*(n+1)
for i in range(1,n+1)[::-1]:
 b[i]+=(sum(b[j] for j in range(i,n+1,i))+a[i-1])%2
print(sum(b))
print(*[i for i in range(n+1) if b[i]>0])
# Judge status: Accepted
x,y,z=map(int,input().split())

print(z,x,y)
# Judge status: Accepted
# coding: utf-8
#N = int(input())
a, b = map(int,input().split())
print(a*b)
# Judge status: Wrong Answer
input_list = input().split()
input_list = [int(num) for num in input_list]

cnt = 0
while int(sum(input_list) % 2) == 1:
  input_list = [num // 2 for num in input_list]
  cnt+=1
print(cnt)
# Judge status: Accepted
x,y=map(int,input().split())
if x>0:
  if y>x:
    print(y-x)
  elif 0<y<x:
    print(x-y+2)
  elif y<=0:
    print(abs(abs(x)-abs(y))+1)
elif x==0:
  if y>0:
    print(y-x)
  else:
    print(x-y+1)
else:
  if y<x:
    print(x-y+2)
  elif x<y<=0:
    print(y-x)
  else:
    print(abs(abs(x)-abs(y))+1)
# Judge status: Wrong Answer
T = list(input())

for index, i in enumerate(T):
    if i != "?":
        continue
    if index + 1 < len(T):
        if T[index + 1] == "D":
            T[index] = "P"
            continue
    T[index] = "D"
print("".join(T))
# Judge status: Accepted
def solve():
    x, k, d = map(int, input().split())
    l = x - k * d
    r = x + k * d
    if l > 0:
        print(l)
        return
    elif r < 0:
        print(-r)
        return
    a1 = r - r // (2 * d) * (2 * d)
    a2 = a1 - (2 * d)
    ans = min(abs(a1), abs(a2))
    print(ans)


if __name__ == "__main__":
    solve()
# Judge status: Accepted
N=int(input())
a=list(map(int,input().split()))
l,r=a.pop(0),sum(a)
ans=10**10
for i in a:
    ans=min(ans,abs(l-r))
    l,r=l+i,r-i
print(ans)
# Judge status: Wrong Answer
# -*- coding: utf-8 -*-
A_B_C = list(map(int, input().split()))
if A_B_C == [5,5,7]:
    print('YES')
else:
    print('NO')
# Judge status: Accepted
S = str(input())
T = str(input())

if T.startswith(S) and len(S)+1 ==len(T):
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
x=int(input())
if x<100:
  print(0)
  exit()
elif 100<=x<=106:
  print(1)
  exit()
else:
  DP=[False]*(x+1)
  for i in range(x+1):
    coin=list(range(100,106,1))
    if i in coin:
      DP[i]=True
      continue
    DP[i]=True if any(DP[i-m] for m in coin) else False
  print(1 if DP[x]==True else 0)
# Judge status: Accepted
X=int(input())
if X>=30:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))

cnt=0
l=[]
for i in a:
  p=i//400
  if p<=7:
    l.append(p)
  else:
    cnt+=1

d=len(set(l))

if d!=0:
  print(d,d+cnt)
else:
  print(1,cnt)
# Judge status: Accepted
A =list(map(int, input().split()))
if A[0]+A[1]>=A[2]:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
S=input()
T=input()
n=len(S)
m=len(T)

for i in range(n-m,-1,-1) :
    x=S[i:i+m]
    for j in range(m+1):
        if j==m :
            print((S[:i]+T+S[i+m:]).replace("?","a"))
            exit()
        if x[j]=="?" :
            continue
        elif x[j]!=T[j] :
            break
 
print("UNRESTORABLE")
# Judge status: Wrong Answer
n,k=map(int,input().split())
while n>0:
  n=n-k
print(abs(n))
# Judge status: Wrong Answer
N = int(input())
an = map(int, input().split(" "))
ans = 0
for i, ai in enumerate(an):
    print(i+1, ai)
    if (i+1) % 2 == 1 and ai % 2 == 1:
        ans += 1
print(ans)
# Judge status: Accepted
A, B, C = map(int, input().split())
if A < C < B or B < C < A:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
A, B, C = (int(x) for x in input().split())
if B//A >= C:
  print(C)
else:
  print(B//A)
# Judge status: Accepted
N = int(input())
p = 1
for i in range(N//7+1):
    if (N - i*7)%4 == 0:
        p = p*0
    else:
        p = p*1
if p == 0:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
import math

N = int(input())

def yakusuu(n):
    lst = []
    for i in range(1, int(math.sqrt(n))+1):
        if(n%i == 0):
            lst.append(i)
    return lst

lst = yakusuu(N)

ans = 10**18
for i in range(len(lst)):
    a = lst[i]
    b = N//lst[i]
    
    ans = min(ans, (a-1)+(b-1))
print(ans)
# Judge status: Accepted
N, X = map(int, input().split(' '))
L_ls = map(int, input().split(' '))
D, cnt = 0, 1
for L in L_ls:
    D += L
    if D > X:
        break
    cnt += 1
print(cnt)
# Judge status: Accepted
N, M = map(int, input().split())
a_list = list(map(int, input().split()))
days = sum(a_list)
if N >= days:
    print(N-days)
else:
    print(-1)
# Judge status: Accepted
n = int(input())
l = list(map(int, input().split()))
ans = 0
for i in range(n):
    for j in range(i + 1, n):
        for k in range(j + 1 , n):
            if l[i] != l[j] and l[i] != l[k] and l[j] != l[k]:
                if l[i] + l[j] > l[k] and l[i] + l[k] > l[j] and l[k] + l[j] > l[i]:
                    ans += 1
print(ans)
# Judge status: Accepted
x, a, b = map(int, input().split())
if abs(x-a) > abs(x-b):
  print("B")
else:
  print("A")
# Judge status: Wrong Answer
n,a,b = map(int,input().split())
if abs(a-b)%2:
    print(abs(a-b)//2+1+min((abs(1-a),abs(10-a),abs(1-b),abs(10-b))))
else:
    print(abs(a-b)//2)
# Judge status: Accepted
X = int(input())
t = 0 
sum_x = 0
while sum_x < X:
  t += 1
  sum_x += t # jump with t
print(t)
# Judge status: Accepted
from fractions import gcd
N, X = map(int, input().split())
x = list(map(int, input().split()))
ans = abs(X - x[0])
if (N == 1):
   print(ans)
   exit(0)
for i in range(1, len(x)):
    ans = gcd(abs(x[i] - x[i - 1]), ans)
print(ans)
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))
suma=sum(a)
b=[0]*(n-1)
total=0
for i in range(n-1):
  total+=a[i]
  b[i]+=total
mini=abs((suma-b[0])-b[0])
for i in range(n-1):
  if mini>abs((suma-b[i])-b[i]):
    mini=abs((suma-b[i])-b[i])
print(mini)
# Judge status: Wrong Answer
s = input()
ans = len(s)
for i in range(2):
  cnt = 0
  for j in range(ans):
    if j % 2 == 0 and s[j] != 0: cnt += 1
    if j % 2 == 1 and s[j] == 0: cnt += 1
  ans = min(ans,cnt)
print(ans)
# Judge status: Accepted
N, M = [int(_) for _ in input().split()]

ans = N * (N - 1) // 2
ans += M * (M - 1) // 2
print(ans)
# Judge status: Wrong Answer
a,b,c = map(int,input().split())
array = [a,b,c]
ans = array.copy()
ans.sort()
if ans == array:
    print('YES')
else:
    print('NO')
# Judge status: Accepted
def judge99(x):
    if x <= 9:
        return True
    else:
        return False

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

if judge99(a) and judge99(b):
    print(a*b)
else:
    print(-1)
# Judge status: Accepted
x,k,d=map(int,input().split())
x=abs(x)
if x>=k*d:
    print(x-k*d)
else:
    cnt=x//d
    if (k-cnt)%2==0:
        print(x-cnt*d)
    else:
        print(abs(x-(cnt+1)*d))
# Judge status: Wrong Answer
#
# author Sidratul
#

from math import prod

if __name__ == '__main__':
    n = int(input())
    for i in range(n, 1, -1):
        c = str(i)
        if i%2 == 1 and not '0' in c:
            print(i)
            break
# Judge status: Accepted
K, A, B = map(int, input().split())

if B - A <= 2:
    print(K + 1)
else:
    ans = 0
    # 初回のA枚→B枚まで A-1 回かかる
    rest = K - A + 1
    # このときにはA枚持っている
    ans += A
    # 残りをすべてA枚→B枚
    ans += rest // 2 * (B - A)
    if rest % 2 != 0:
        ans += 1
    print(ans)
# Judge status: Accepted
S = input()
x = 0
for i in range(len(S)):
    if S.count(S[i]) == 2:
        x += 1

if x == 4:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
n = int(input())
ans = 0
for i in range(1, n + 1):
    if i % 3 != 0 and i % 5 != 0:
        ans += i
print(ans)
# Judge status: Accepted
import sys
import fractions
from functools import reduce
input = sys.stdin.readline
n, m = [int(x) for x in input().strip().split()]
a = [int(x)//2 for x in input().strip().split()]
a = list(set(a))

def lcm_base(x, y): return x * y // fractions.gcd(x, y)
lcm = reduce(lcm_base, a, 1)


for x in a:
    if (lcm // x) % 2 == 0:
        print(0)
        break
else:
    print((m // lcm + 1) // 2)
# Judge status: Wrong Answer
N=int(input())
P=1
for i in range(N):
    P = P*(i+1)
print(P)
# Judge status: Accepted
a,b,c=sorted(map(int,input().split()))
print(10*c+b+a)
# Judge status: Wrong Answer
X = input()
N = len(X)

right = N - 1
cnt = 0

for left in range(N - 1):
    if X[left] == 'S':
        while X[right] != 'T':
            right -= 1
        if left < right:
            cnt += 1
print(N - cnt * 2)
# Judge status: Accepted
import sys

N = int(input())
CSF = [list(map(int, sys.stdin.readline().rsplit())) for _ in range(N - 1)]

for i in range(N - 1):
    res = 0
    for c, s, f in CSF[i:]:
        if res < s:
            res = s + c
        elif res % f == 0:
            res += c
        else:
            res += f - (res % f) + c
    print(res)
print(0)
# Judge status: Wrong Answer
import fractions as fc
import math
a,b,c,d=map(int,input().split())
ccnt=(b//c)-math.ceil(a//c)
dcnt=(b//d)-math.ceil(a//d)
e=int(c*d/fc.gcd(c,d))
ecnt=(b//e)-math.ceil(a//e)
ans=(b-a+1)-(ccnt+dcnt-ecnt)
if ans<0:
	ans=0
print(ans)
# Judge status: Accepted
A,B,X = map(int, input().split())
print("YES" if X-A<=B and A<=X else "NO")
# Judge status: Accepted
n = int(input())    
t,a = map(int,input().split())
A =  list(map(int,input().split()))
B = [abs(t - A[i]*0.006 -a) for i in range(n)]
print(min(enumerate(B), key = lambda x:x[1])[0] +1 )
# Judge status: Wrong Answer
# -*- coding: utf-8 -*-
import numpy as np
from collections import deque
from collections import defaultdict
import heapq
import collections
import itertools
import bisect


def zz():
    return list(map(int, input().split()))


def z():
    return int(input())


def S():
    return input()


def C(line):
    return [input() for _ in range(line)]


N, K = zz()
if(N >= K):
    ans = (N-K+1)/N
else:
    ans = 0
for n in range(1, min(K, N+1)):
    x = max(int(np.log2(K/n))+1, 0)
    # print('n=', n, 'x=', x)
    tmp = 1/N * pow(1/2, x)
    ans += tmp
print(ans)
# Judge status: Accepted
target = int(input())
num = target
waru = 2
exp = []
while waru ** 2 <= target and num > 1:
    rep = 0
    while num % waru == 0:
        num /= waru
        rep += 1
    waru += 1
    if rep > 0:
        exp.append(rep)
if num > 1:
    exp.append(1)
ans = 0
for item in exp:
    hiku = 1
    while item - hiku >= 0:
        item -= hiku
        ans += 1
        hiku += 1
print(ans)
# Judge status: Accepted
s = input()
flag = True
if ("N" in s) ^ ("S" in s):
    flag = False
if ("W" in s) ^ ("E" in s):
    flag = False
if flag == True:
    print("Yes")
else:
    print("No")
# Judge status: Accepted

     

import math



H,N = map(int,input().split())
Damage = []
Cost = []


DP = [0] + [pow(10,9)] * (H+1)



for i in range(N):
    a,b = map(int,input().split())
    Damage.append(a)
    Cost.append(b)
    
#print(DP)


# DP[i] = min magic points to do i damage

for i in range(1,len(DP)):
    for spell in range(N):
        DP[i] = min(DP[i],DP[max(0,i-Damage[spell])]+Cost[spell])




print (DP[H])
# Judge status: Accepted
A, B, C =map(int, input().split())
if A + B < C:
  print("No")
else:
  print("Yes")
# Judge status: Accepted
X, Y = map(int, input().split())
for i in range(X + 1):
    if i * 2 + (X - i) * 4 == Y:
        print('Yes')
        break
else:
    print('No')
# Judge status: Wrong Answer
n = int(raw_input())
ais = map(int, raw_input().split()) 
b = ais[-1] - n
q = 0
for i in range(len(ais)-1):
	u = i+1
	q += abs(ais[i] - (b+u))
print q
# Judge status: Accepted
N = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
C = list(map(int,input().split()))
total = B[A[0]-1]
for i in range(1,N):
  dish = A[i]
  score = B[dish-1]
  before = A[i-1]
  if dish == before + 1:
    score += C[before-1]
  total += score
print(total)
# Judge status: Accepted
n = int(input())
a = [int(input()) for _ in range(n)]
idx = a.index(max(a))
a.sort()
for i in range(n):
    if i==idx:
        print(a[-2])
    else:
        print(a[-1])
# Judge status: Accepted
H,A=map(int,input().split())

if(H%A==0):
    print(H//A)
else:
    print(H//A+1)
# Judge status: Accepted
print (input().replace('2017/','2018/'))
# Judge status: Accepted
a,b = input().split()
a = int(a)
b = int(b)
ans = a * (a-1) / 2 + b * (b-1) / 2
print(int(ans))
# Judge status: Accepted
stdin = input().split(" ")
A = int(stdin[0])
B = int(stdin[1])

if A <= 5:
    print("0")
elif 6 <= A <= 12:
    print(B//2)
else:
    print(B)
# Judge status: Accepted
N,K=map(int, input().split())

list=[]
while N>=K:
    x=N%K
    N=N//K
    list.append(x)

list.append(N)
print(len(list))
# Judge status: Accepted
x, y = map(int, input().split())

a = max(0, y - x)
b = max(0, -1 * y - x + 1)
c = max(0, y + x + 1)
d = max(0, -1 * y + x + 2)

l = [a, b, c, d]

ans = 1000000000000

for i in l:
    if i != 0 and i < ans:
        ans = i

print(ans)
# Judge status: Wrong Answer
s = map(int, raw_input().split(' '))
print sum(s) + 10 *max(s)
# Judge status: Accepted
import math
from collections import defaultdict
from itertools import accumulate
N=int(input())
data=defaultdict(int)
result=0
for i in range(2,int(math.sqrt(N))+1):
    while N%i==0:
        N//=i
        data[i]+=1
if N!=1:
    data[N]+=1
cumsum=list(accumulate(range(1,10**6*2)))
for value in data.values():
    for i in range(10**6*2):
        if value<cumsum[i]:
            result+=i
            break
if result==0:
    if N!=1:
        result=1
print(result)
# Judge status: Accepted
print(*[i[0] for i in input().split()],sep='')
# Judge status: Wrong Answer
n = int(input())
a = list(map(int, input().split()))
cnt = 1
i = -1
flg = True
while True:
  i += 1
  if i >= n-1:
    break
  if a[i] < a[i+1]:
    flg = True
  elif a[i] > a[i+1]:
    flg = False
  else:
    continue
  for k in range(i, n-1):
    if (flg and a[k] > a[k+1]) or ((not flg) and a[k] < a[k+1]):
      cnt += 1
      i = k
      break
# Judge status: Accepted
h,w = map(int,input().split())
if h==1 or w==1:
  print(1)
else:
  print((h*w+1)//2)
# Judge status: Accepted
S = input()
if S[2] == S[3] and S[4] == S[5]:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
N = int(input())
Sum = 0
for i in range(1, N + 1):
    Sum += i
print(Sum)
# Judge status: Accepted
n=int(input())
dp=[0]*(n+120)
dp[100]=1
dp[101]=1
dp[102]=1
dp[103]=1
dp[104]=1
dp[105]=1

for i in range(100,n+1):
    if not dp[i]: continue
    dp[i+100:i+106]= [1]*6
print(dp[n])
# Judge status: Accepted
k, s = map(int,input().split())
ans = 0
for i in range(k+1):
    for j in range(k+1):
        if 0 <= s-i-j and s-i-j <= k:
            ans += 1
        else:
            continue
print(ans)
# Judge status: Accepted
N = int(input())
res = [[0 for _ in range(9)] for _ in range(9)]
for i in range(1, N + 1):
    if i % 10:  res[int(str(i)[0]) - 1][i % 10 - 1] += 1
ans = 0
for i in range(1, N + 1):
    if i % 10:  ans += res[i % 10 - 1][int(str(i)[0]) - 1]
print(ans)
# Judge status: Wrong Answer
n = raw_input()

if 'hii' in n:
  print("No")
elif 'hi' in n:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
#python3

def main():
    s = input()
    tmp = ['x']*len(s)
    ans = ''.join(tmp)
    print(ans)
main()
# Judge status: Accepted
n = int(input())
lst1 = list(map(int,input().split()))
mod = 10**9+7
 
def GCD(a,b):
    if b == 0:
        return a
    else:
        return GCD(b,a%b)
def LCM(a,b):
    return (a//GCD(a,b)*b)

l = 1
for i in lst1:
    l = LCM(l,i)

ans = 0
for i in range(n):
    ans += l//lst1[i]
 
print(ans%mod)
# Judge status: Accepted
import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

N = list(map(int, input()))

def solve(N):
    dp = (0, 1) # n円の場合とn+1円の場合
    for n in N:
        a = min(dp[0] + n, dp[1] + 10 - n)
        b = min(dp[0] + n + 1, dp[1] + 10 - (n+1))
        dp = (a, b)
    return dp[0]

print(solve(N))
# Judge status: Wrong Answer
h1, m1, h2, m2, k = map(int, input().split())
t1 = h1 * 60 + m1
t2 = h2 * 60 + m1
print(t2-t1 - k)
# Judge status: Accepted
import sys
A,B,T = map(int,input().split())
if not ( 1 <= A <= 20 and 1 <= B <= 20 and 1 <= T <= 20 ): sys.exit()

time_remind = T+0.5
sum = 0
for I in range(1,T+1):
    time_remind -= A
    if time_remind >= 0: sum += B
print(sum)
# Judge status: Wrong Answer
N, C, K = map(int, input().split())
T = [0 for _ in range(N)]
for i in range(N):
    T[i] = int(input())
T = sorted(T)

flag = 0
cnt = 0
ans = 0
for i in range(len(T)):
    time = T[i] - T[flag]
    cnt += 1
    if time > K or cnt > C:
        flag = i
        cnt = 0
        ans += 1
print(ans + 1)
# Judge status: Accepted
S = input()
if S=='abc' or S=='acb' or S=='bac' or S=='bca' or S=='cab' or S=='cba':
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
def gcd(x, y):
  while(x % y != 0 and y % x != 0):
    if(x > y):
      x = x % y
    else:
      y = y % x
  if(x > y):
    return y
  else:
    return x
  
N = int(input())
A = list()
for i in range(N):
  A.append(int(input()))

ans = 1
for i in range(N):
  gcd_i = gcd(A[i], ans)
  print(gcd_i)
  ans = A[i] * ans // gcd_i
  
print(ans)
# Judge status: Accepted
s = input()

for i in range(len(s)):
    print("x", end="")
print()
# Judge status: Accepted
a,v=map(int,input().split())
b,w = map(int,input().split())
t=int(input())


if a<=b:

    dist_a = a + t*v

    dist_b = b + t*w

    if dist_a>=dist_b:
        print('YES')
    else:
        print('NO')
else:

    dist_a = a - t*v

    dist_b = b - t*w

    if dist_a<=dist_b:
        print('YES')
    else:
        print('NO')
# Judge status: Accepted
def main():
    k, a, b = map(int, input().split())
    if (b - a) <= 2:
        ans = k + 1
    else:
        n = (k - (a - 1)) // 2
        ans = n * b - (n - 1) * a + (k - (a - 1)) % 2

    print(ans)


if __name__ == '__main__':
    main()
# Judge status: Accepted
#import functools

def main():
    S = input()
    T = input()
    ans = 0
    for i in range(len(S)):
        if not S[i] == T[i]:
            ans += 1
    print(ans)


if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
input_line = input()
input2 = input_line.rstrip().split(" ")
a,b,c = [int(i) for i in input2]
count = 0
max_num = int(input())
while count<=max_num:
  if a >= b:
    b*=2
    count += 1
  else:
    break
 

    
while count<=max_num:
  if b >= c:
    c*=2
    count += 1
  else:
    break
    
if a<b<c:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
x=int(input())
 
if x<100:
	print("0")
	exit()

while 1:
	tm=(str(x)[-2:])
	if int(tm) > 5:
		x-=105
	else:
		print("1")
		exit()
		
	if x<100:
		print("0")
		exit()
# Judge status: Accepted
S=input()
T=input()
if len(T)!=len(S)+1:
  print('No')
  exit()
if S!=T[:-1]:
  print('No')
  exit()
print('Yes')
# Judge status: Accepted
(str_len,cng_cnt) = input().split(" ")
str_input = list(input())

str_len= int(str_len)
cng_cnt= int(cng_cnt)
tmp1=""
cnt=0
cnt2=0
for st in str_input:
    if(tmp1 == st ):
      cnt = cnt+1
    else:
      cnt2= cnt2 + 1
      
    tmp1=st

if (cng_cnt < cnt2-1 ):
	c_up = cng_cnt * 2 
else:
	c_up= (cnt2 * 2) + (cng_cnt - cnt2)
ans =cnt + c_up

if(ans >= str_len):
  ans =str_len-1

print(ans)
# Judge status: Accepted
n,m =map(int,input().split())
s = []
e = []
for i in range(m):
    a,b = map(int,input().split())
    if a ==1:
        s.append(b)
    if b == n:
        e.append(a)
if set(s)&set(e):
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")