peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
import math


def solve(h, a):
    return math.ceil(h / a)


def main():
    h, a = map(int, input().split())

    ans = solve(h, a)
    print(ans)


main()
# Judge status: Wrong Answer
# B fLIP
n,m,k=map(int,input().split())

for h in range(n):
    for w in range(m):
        black=m*h+n*w-2*h*w
        if black==k:
            print('Yes')
            exit()
print('No')
# Judge status: Accepted
n, m, x = map(int, input().split())
c = []
a = []
for i in range(n):
    tmp = list(map(int, input().split()))
    c.append(tmp[0])
    a.append(tmp[1:])

min_cost = -1

for i in range(2**n):
    cost = 0
    skills = [0] * m

    for j in range(n):
        if (i >> j) & 1:
            cost += c[j]
            skills = [skills[k] + a[j][k] for k in range(m)]

    if min(skills) >= x and (cost < min_cost or min_cost == -1):
        min_cost = cost

print(min_cost)
# Judge status: Wrong Answer
N,M=map(int,input().split())
if (N+M)%2==0:
  print((N+M)/2)
else:
  print("IMPOSSIBLE")
# Judge status: Wrong Answer
A=int(input())
B=int(input())
if 1 not in [A,B]:
    print(1)
if 2 not  in [A,B]:
    print(2)
else:
    print(3)
# Judge status: Wrong Answer
n,k,q=[int(i) for i in input().split()]
a=[]
for i in range(q):
    a.append(int(input()))
    
point=[k-q]*n

for i in a:
    point[i-1]+=1
    
for i in point:
    if i>0:
        print("YES")
    else:
        print("NO")
# Judge status: Wrong Answer
import itertools

N,K = [int(s) for s in input().split(" ") ]

l = list(range(0,N+1))

num = 0
for i in list(range(K, len(l)+1)):
  num += len(list(itertools.combinations(l, i)) )

print(num)
# Judge status: Wrong Answer
a,b,c,d=map(int,input().split())
x=1
if a/2==c and b%2 or b/2==d and a%2:
  x=0
s=str((a*b)/2)+" "+str(x)
print(s)
# Judge status: Wrong Answer
x = int(input())
a = x//11
b = x%11

if b > 6:
    print(2*a+2)
else:
    print(2*a+1)
# Judge status: Accepted
a,b=map(int,input().split());c=[a,b,a-1,b-1];c.sort();print(sum(c[-2:]))
# Judge status: Wrong Answer
from sys import stdin


def get_result(data):
    return 'x' * len(data[0])

if __name__ == '__main__':
    data = list(map(str, stdin.readline().split(' ')))
    # result = get_result(data)
    print('x' * len(data[0]))
# Judge status: Accepted
S=input()
T=input()

slist,sdic=[],{}
tlist,tdic=[],{}
for i in range(len(S)):
  if not S[i] in sdic:
    sdic[S[i]]=len(sdic)+1
  slist.append(sdic[S[i]])
  
  if not T[i] in tdic:
    tdic[T[i]]=len(tdic)+1
  tlist.append(tdic[T[i]])

#print(slist)
#print(tlist)
if slist==tlist:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
N = int(input())
dis = int(N / 15)
print(N * 800 - dis * 200)
# Judge status: Accepted
# =map(int,input().split())
S=input()
count=0
for i in range(len(S)):
    if i % 2== 0:#奇数の時
        if S[i]=="R" or S[i]=="U" or S[i]=="D":
            count+=0
        else:
            count+=1
    else:
        if S[i]=="L" or S[i]=="U" or S[i]=="D":
            count+=0
        else:
            count+=1
           
if count==0:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
if input().isupper():
  print('A')
else:
  print('a')
# Judge status: Accepted
def main(k, a, b):
    for i in range(a, b + 1):
        if i % k == 0:
            print("OK")
            return

    print("NG")


if __name__ == "__main__":
    k = int(input())
    a, b = map(int, input().split())

    main(k, a, b)
# Judge status: Wrong Answer
a,b = map(int,input().split())

ans_min = min(int(a*12.5),int(b*10))
ans_max = max(int(a*12.5),int(b*10))

for i in range(ans_min,ans_max+1):
    if a == int(i*0.08) and b == int(i*0.1):
        print(i)
        exit()

print(-1)
# Judge status: Wrong Answer
N, W = map(int, input().split())
WV = [list(map(int, input().split())) for _ in range(N)]
dp = [[0] * (W+1) for i in range(N+1)]

for i in range(1,N+1):
    w, v = WV[i-1]
    for j in range(1, W+1):
        if j-w < 0:
            dp[i][j] = dp[i-1][j]
        else:
            dp[i][j] = max(dp[i][j-1], dp[i-1][j-w]+v)

ret = 0
for i in dp:
    ret = max(ret, i[-1])
print(ret)
# Judge status: Wrong Answer
import math
a,b,c,d = map(int,input().split())

a -= 1
a_b = c * d // math.gcd(c, d)
print(a_b)
ans_a = a - (a // c + a // d - a // a_b)
ans_b = b - (b // c + b // d - b // a_b)

print(int(ans_b-ans_a))
# Judge status: Accepted
N = input()
print("Yes" if N[0] == "9" or N[1] == "9" else "No")
# Judge status: Accepted
N=int(input())
if N%2==0:
    print((N//2)/N)
else:
    print((N//2+1)/N)
# Judge status: Wrong Answer
n=int(input())
s=input()
from itertools import groupby
gr=groupby(s)
c=[]
for k,g in gr:
  c.append((k,len(list(g))))
b,w=0,0
b=s.count("#")
if s[-1]=="#":
  b-=1
f=False
for k,v in c:
  if f:
    if k==".":
      w+=v
      f=False
  else:
    if k=="#":
      f=True
print(min(b,w))
# Judge status: Accepted
a = int(input())
b = int(input())
c = int(input())
x = int(input())
cnt=0
for i in range(a+1):
    for j in range(b+1):
        for k in range(c+1):
            if (i*500)+(j*100)+(k*50)==x:
                cnt+=1
print(cnt)
# Judge status: Accepted
n, m = map(int, input().split())

A = [1] * (n + 1)
red = [False] * (n + 1)
red[1] = True

for i in range(1, m + 1):
	x, y = map(int, input().split())
	if red[x]:
		red[y] = True
	A[x] -= 1
	A[y] += 1
	if A[x] == 0:
		red[x] = False

print(len([red[i] for i in range(1, n + 1) if red[i]]))
# Judge status: Wrong Answer
N=input()
l=len(N)-1
h=int(N[0])-1
print(h+9*l)
# Judge status: Accepted
n,l=map(int,input().split())
a=list(range(l,l+n,1))
x=sum(a)
if(0 in a):
  a.remove(0)
  print(sum(a))
elif(x<0):
  a.remove(max(a))
  print(sum(a))
elif(x>0):
  a.remove(min(a))
  print(sum(a))
# Judge status: Accepted
a=[*input()];print('NYoe s'[len(set(a[:3]))==1 or len(set(a[1:]))==1::2])
# Judge status: Accepted
S=input()
S=S[S.find('A'):S.rfind('Z')+1]
print(len(S))
# Judge status: Accepted
# -*- coding: utf-8 -*-
n = int(input())
l = list(map(int,input().split()))
l.sort()
ans = 0
for i in range(n):
  for j in range(i+1,n):
    for k in range(j+1,n):
      a = l[i]
      b = l[j]
      c = l[k]      
      
      if a == b or b == c or c == a:
        continue
        
      if a + b > c:
        ans += 1

print(ans)
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
cnt = 1
b = [0] + a
c = [(i-j)//abs(i-j) for i, j in zip(a, b) if i != j]
del c[0]
if c:
  mae=c[0]
  d=iter(c)
  for x in d:
    if x != mae:
      cnt += 1
      try:
        mae = d.__next__()
      except StopIteration:
        break
print(cnt)
# Judge status: Accepted
w = input()
wo = "x" * len(w)
print(wo)
# Judge status: Wrong Answer
import sys
readline = sys.stdin.readline
from collections import Counter

def main():
    N = int(readline())
    A = list(map(int, readline().rstrip().split()))
    c = Counter(A)
    ans = 0
    for i in range(min(A)+1, max(A)):
        ans = max(ans, c[i-1]+c[i]+c[i+1])
    
    print(ans)


if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
en=int(input())

res = en/500*1000+(en%500)/5*5
print(res)
# Judge status: Accepted
tenki = str(input())
count = 0
tenki_list = []
for n in tenki:
    if n == 'R':
        count +=1
    else:
        count = 0
    tenki_list.append(count)
print(max(tenki_list))
# Judge status: Accepted
s = input()
bad = 0
for i in range(1, len(s)):
    if s[i] == s[i-1]:
        bad = 1
        break

if bad:
    print('Bad')
else:
    print('Good')
# Judge status: Accepted
a,b=map(int,input().split())
ans=0
while a*ans-(ans-1)<b:
    ans+=1
print(ans)
# Judge status: Accepted
N = int(input())
print(int(N ** 0.5)**2)
# Judge status: Accepted
a, b, c, k = list(map(int, input().split()))
if k <= a:
    ans = k
elif k <= a+b:
    ans = a
else:
    ans = a - (k - a - b)
    
print(ans)
# Judge status: Accepted
import sys
S = str(input())
if len(S) < 2 or len(S) > 27:
    sys.exit()
if not S.islower():
    sys.exit()

result = 'yes'
for I in range(len(S)):
    if S.count(S[I]) > 1:
        result = 'no'
print(result)
# Judge status: Accepted
n, k = map(int, input().split())
ans = 10**9

h = [int(input()) for _ in range(n)]
h.sort()

for i in range(n):
    if i + k - 1 >= n:
        break
    ans = min(h[i + k - 1] - h[i], ans)

print(ans)
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))

s = 0

b = [abs(x) for x in a]

c = 0
for x in a:
    if x < 0:
        c += 1

if c % 2 == 0:
    s = sum(b)
else:
    s = sum(b) - 2 * min(b)

print(s)
# Judge status: Wrong Answer
n, m = map(int, input().split())
if 2*n >= m:
    ans = m//2
else:
    ans = n - (2*n - m)//4 -1
print(ans)
# Judge status: Wrong Answer
H, N = [int(i) for i in input().split()]
A=[]; B=[]
for _ in range(N):
    a, b = [int(i) for i in input().split()]
    A.append(a); B.append(b)

# A : value  B : weight
INF = 10**9
dp = [[INF for _ in range(20010)] for _ in range(N+10)]

for i in range(N): dp[i][0] = 0

for i in range(N):
    for w in range(H+10000):
        dp[i+1][w] = min(dp[i+1][w], dp[i][w])
        if w >= A[i]: dp[i+1][w] = min(dp[i+1][w], dp[i+1][w-A[i]]+B[i])

print(dp[N][H])
# Judge status: Wrong Answer
import sys
word = input()

if len(word) != 4:
  print('No')
  sys.exit()

if not word.isupper() or not word.isalpha() :
  print('No')
  sys.exit()
    
word_cnt = {}

for s in word:
  if s in word_cnt.keys():
    if word_cnt[s] != 1:
      print('No')
      sys.exit()
    word_cnt[s] += 1
  else:
    word_cnt[s] = 1
  
print('Yes')
# Judge status: Wrong Answer
n = int(input())
t, a = map(int,input().split())

h = list(map(int, (input().split())))
min = abs(a - (t - h[0]*0.006))
ans = 1

for i in range(1, n):
    if (min > abs(a - (t - h[i]*0.006))):
        min = a - (t - h[i]*0.006)
        ans = i+1

print(ans)
# Judge status: Wrong Answer
n = int(input())
s = [input() for i in range(n)]

ss = sorted(s)
test = ss[0]
count = 1

for i in range(n):
  if test != s[i]:
    test = s[i]
    count += 1
    
print(count)
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))
cnt = [0] * (N+1)
ans = 0
for i in range(N):
  cnt[A[i]] +=1
for i in range(N+1):
  ans += cnt[i] * (cnt[i] - 1) // 2
for i in range(N):
  print(ans - cnt[A[i]] + 1)
# Judge status: Accepted
N,M=map(int,input().split())
s = [tuple(map(int,input().split())) for _ in range(N)]
c = [tuple(map(int,input().split())) for _ in range(M)]

def calc_dict(p1,p2):
  return abs(p1[0]-p2[0])+abs(p1[1]-p2[1])

for i in range(N):
  dist = list(map(lambda x:calc_dict(s[i],x),c))
  print(dist.index(min(dist))+1)
# Judge status: Accepted
from itertools import groupby
N =int(input())
d = [input() for i in range(N)]

d.sort()
#print(d)
p=-1
b=[]
for key, value in groupby(d):
  a = len(list(value))
  if p<a:
    #print(p,len(list(value)))
    b=[]
    b.append(key)
    p=a
  elif p==a:
    #print(222)
    b.append(key)
for i in b:
  print(i)
# Judge status: Wrong Answer
n=int(input())

k=0
for i in range(9,1,-1):
        if n%i==0:
            n=n//i
            if n>9:
                k+=1
                break
if k>0:
        print('No')
else:
        print('Yes')
# Judge status: Accepted
from collections import deque
k=int(input())
queue=deque(range(1,10))
x=0
for _ in range(k):
  x=queue.popleft()
  if not x%10==0:
    queue.append(10*x+(x%10)-1)
  queue.append(10*x+(x%10))
  if not x%10==9:
    queue.append(10*x+(x%10)+1)
print(x)
# Judge status: Wrong Answer
# https://atcoder.jp/contests/agc015/tasks/agc015_a

import math
n, a, b = map(int, input().split())

if b < a:
    print(0)
else:
    t = b - a + 1
    ans = math.factorial(t + n - 1) // (math.factorial(t) * math.factorial(n))
    print(ans)
# Judge status: Accepted
def calculate(s, t):
    a = sorted(s)
    b = sorted(t,reverse=True)

    m = "".join(a)
    k = "".join(b)

    if m < k:
        print("Yes")
    else:
        print("No")


# s = 'yx'
# t = 'axy'
#
# s = 'ratcode'
# t = 'atlas'
#
# s = 'cd'
# t = 'abc'
#
# s = 'w'
# t = 'ww'

s = input()
t = input()
calculate(s, t)
# Judge status: Accepted
S = input()
if S == 'ABC':
    print('ARC')
else:
    print('ABC')
# Judge status: Accepted
K, A, B = map(int, input().split())

x = (K - (A - 1)) // 2 * (B - A) + A
if (K - (A - 1)) % 2 != 0:
    x += 1

print(max(x, K + 1))
# Judge status: Accepted
S = input()
T = input()

minCount = len(T)
for i in range(len(S)-len(T)+1):
    count = 0
    for j in range(len(T)):
        if S[i+j] != T[j]:
            count += 1
    minCount = min(minCount, count)

print(minCount)
# Judge status: Accepted
H, A = map(int,input().split())
print( H//A if H%A == 0 else H//A+1)
# Judge status: Accepted
import sys
from collections import deque

def main(sa,sb,sc):
    sa=deque(sa)
    sb=deque(sb)
    sc=deque(sc)
    ms={'a':sa, 'b':sb, 'c':sc}
    ct='a'
    while True:
        cc=ms[ct].popleft()
        ct=cc
        if not ms[ct]:
            return ct.upper() 

sa=sys.stdin.readline().strip()
sb=sys.stdin.readline().strip()
sc=sys.stdin.readline().strip()

print(main(sa,sb,sc))
# Judge status: Accepted
n = int(input())
A = [0] * n
B = [0] * n
ans = 0
mod = 0
for i in range(n):
    A[i], B[i] = map(int, input().split())

for i in range(n-1, -1, -1):
    ans += 0 if (A[i]+ans)%B[i]==0 else B[i] - (A[i]+ans)%B[i]
print(ans)
# Judge status: Wrong Answer
n, T = map(int, input().split())
c = [0 for _ in range(n)]
t = [0 for _ in range(n)]
for i in range(n):
    c[i], t[i] = map(int, input().split())

ans = 1000

for i in range(n):
    if t[i] <= T:
        ans = min(ans, c[i])
print(ans)
# Judge status: Accepted
#Educational DP Contest
#B-Frog2

import sys
input = sys.stdin.readline

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

#dp table
dp = [float("inf")]*n
dp[0] = 0

#process1
for i in range(1,n):
    for j in range(max(0,i-k),i): #kの許容しうる範囲だけ回す
        b = abs(lst1[i]-lst1[j]) + dp[j] #(j迄の最小コスト)+(jからiまでのコスト)
        dp[i] = min(dp[i],b)

#output process
print(dp[-1])
# Judge status: Wrong Answer
su=0
for i in range(3):
  l=list(map(int,input().split()))
  s=sum(l)
  su+=s
print('Yes' if su%3==0 else 'No')
# Judge status: Accepted
h = int(input())
w = int(input())
n = int(input())

if h > w:
    print(-(-n//h))
else:
    print(-(-n//w))
# Judge status: Wrong Answer
import random
s=list(input())
print(''.join(random.sample(s, 3)))
# Judge status: Wrong Answer
x,a,b=map(int,input().split())
print(min(abs(x-a),abs(x-b)))
# Judge status: Wrong Answer
import math
list=[int(input()) for x in range(5)]
ans=[]
for l in list:
  ans.append(math.ceil(l/10)*10)
print(sum(ans))
# Judge status: Wrong Answer
number = int(input())

result = 1
for index in range(1, number):
  result = result * index
  
  
dividor = 10 ** 9 + 7
print (result % dividor)
# Judge status: Accepted
#!/usr/bin.env python3

N,K = map(int,input().split())
queries = [list(map(int,input().split())) for _ in range(N)]

queries = sorted(queries,key=lambda x: x[0])

arrayLength = 0
for i in range(N):
  arrayLength += queries[i][1]
  if arrayLength >= K:
    print(queries[i][0])
    exit()
print(-1)
# Judge status: Accepted
import sys
input = lambda: sys.stdin.readline().rstrip("\r\n")

n = int(input())

ans = [0]*10**5

for i in range(1, 101):
    for j in range(1, 101):
        for k in range(1, 101):
            ans[i**2 + j**2 + k**2 + i*j + j*k + k*i] += 1
print(*ans[1:n + 1], sep='\n')
# Judge status: Accepted
def main():
  input()
  in_a = list(map(int, input().split()))
  leaves = [0] * len(in_a)
  leaves[-1] = in_a[-1]

  if in_a[0] > 1:
    print(-1)
    return

  for i in range(len(in_a)-2, -1, -1):
    leaves[i] = leaves[i+1] + in_a[i]

  node = 1
  total = 1
  
  for i in range(1, len(in_a)):
    n = (node - in_a[i-1]) * 2

    if n < in_a[i]:
        print(-1)
        return

    node = min(n, leaves[i])
    total += node

  print(total)

if __name__ == '__main__':
  main()
# Judge status: Wrong Answer
a,b = map(int,input().split())
if (a+b) % 2 == 0:
  print(int((a+b)/2))
else:
  print("impossible")
# Judge status: Accepted
from collections import defaultdict

s = input()

cnt = defaultdict(int)
cnt[0] += 1
tmp = 0
for i, c in enumerate(s[::-1]):
    c = int(c)
    tmp = (tmp + c * pow(10, i, 2019)) % 2019
    cnt[tmp] += 1
# print(cnt)

print(sum(c * (c - 1) // 2 for c in cnt.values()))
# Judge status: Accepted
from heapq import heappush, heappop

N, M = map(int, input().split())
X = [list(map(int, input().split())) for _ in range(N)]

pq = []
for a, b in X:
    heappush(pq, (a, b))
    
cand = []
ans = 0
for t in range(1, M + 1):
    while pq:
        a, b = heappop(pq)
        if a <= t:
            heappush(cand, -b)
        else:
            heappush(pq, (a, b))
            break

    if cand:
        v = heappop(cand)
        ans += -v

print(ans)
# Judge status: Wrong Answer
S=input()
if S[0]!=S[2] or S[0]!=S[3]:
    if S[0]==S[1] and S[2]==S[3]:
        print('YES')
    elif S[0]==S[3] and S[2]==S[1]:
        print('YES')
    elif S[0]==S[2] and S[3]==S[1]:
        print('YES')
    else:
        print('NO')
else:
    print('NO')
# Judge status: Wrong Answer
N, A, B = map(int, input().split())
count = 0
num1  = 0
num2  = 0
for i in range(1, N + 1):
    if i < 10:
        if i >= A and i <= B:
            count = count + i
    else:
        num1 = str(i)[0]
        num2 = str(i)[1]
        num = int(num1) + int(num2)
        if num >= A and num <= B:
            count = count + 1
print(count)
# Judge status: Accepted
n = int(input())
dp = [[0]*3 for i in range(n)]
li = [list(map(int, input().split())) for i in range(n)]
dp[0] = li[0]

for i in range(1,n):
    dp[i][0] = max(dp[i-1][1]+li[i][0], dp[i-1][2]+li[i][0])
    dp[i][1] = max(dp[i-1][0]+li[i][1], dp[i-1][2]+li[i][1])
    dp[i][2] = max(dp[i-1][0]+li[i][2], dp[i-1][1]+li[i][2])

print(max(dp[-1][0], dp[-1][1], dp[-1][2]))
# Judge status: Accepted
from math import gcd

K = int(input())
total = 0
for a in range(1,K+1):
    for b in range(1,K+1):
        for c in range(1,K+1):
            total += gcd(gcd(a,b),c)
print(total)
# Judge status: Accepted
from bisect import bisect_left

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

ans = 0
for small in range(n - 2):
    for mid in range(small + 1, n - 1):
        div = bisect_left(arr, arr[small] + arr[mid], 0, n)
        if div > mid + 1:
            ans += div - mid - 1

print(ans)
# Judge status: Accepted
n, c, k = list(map(int, input().split()))
t = []

for i in range(n):
    t.append(int(input()))

t = sorted(t)

cnt = 1
cap = 1
first = t[0]

for i in range(1, n):
    if t[i] > first + k:
        cnt += 1
        cap = 1
        first = t[i]
    elif cap == c:
        cnt += 1
        cap = 1
        first = t[i]
    else:
        cap += 1

print(cnt)
# Judge status: Wrong Answer
N=int(input())
A=list(map(int,input().split()))
G=1000
K=0
for i in range(N-1):
  if A[i+1]>A[i]:
    K=int(G/A[i])
    G=G % A[i]
  if A[i+1]<A[i]:
    G=G+A[i]*K
    K=0
G=G+A[N-1]*K
print(G)
# Judge status: Accepted
f=lambda:list(map(int,input().split()))
n=f()[0];l=f();c,t=0,l[0]
for a,b in zip(l[1:],f()):
  s=min(t+a,b);t=min(max(t+a-s,0),a);c+=s
print(c)
# Judge status: Wrong Answer
N, M = map(int, input().split())
prices = list(map(int, input().split()))
prices.sort()
discounts = prices[:M]
proper = prices[M:]

for i in range(M):
    max_idx = discounts.index(max(discounts))
    discounts[max_idx] = discounts[max_idx] // 2

print(sum(discounts)+sum(proper))
# Judge status: Accepted
#!/usr/bin/env python3
def main():
    a, b, c, d = map(int, input().split())

    ans = -10 ** 20
    for x in [a, b]:
        for y in [c, d]:
            ans = max(ans, x * y)
    print(ans)


if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
N,M = map(int,input().split())
if(min(N,M)==1):
    print(max(N,M)-2)
else:
    print(max(N-2,0)*max(M-2,0))
# Judge status: Wrong Answer
import collections

N, x = map(int, input().split())
A_lis = list(map(int, input().split()))
A_q = collections.deque(A_lis)

con = 0
tmp1 = A_q.popleft()
for i in range(N-1):
    tmp2 = A_q.popleft()
    if tmp1 + tmp2 > x:
        con += (tmp1 + tmp2) - x
        tmp1 = max(0, tmp1 - x)
    else:
        tmp1 = tmp2

print(con)
# Judge status: Accepted
#import 
#=input()
n=int(input())
#=map(int,input().split())
#=list(map(int,input().split()))
#=[list(map(int,input().split())) for _ in range()]

print((10 ** n - 2 * (9 ** n) + 8 ** n) % (10 ** 9 + 7))
# Judge status: Wrong Answer
def resolve():
	s = input()
	t = input()
	if sorted(s) == sorted(t):
		print('Yes')
	else:
		print('No')
resolve()
# Judge status: Accepted
s,t = map(str,input().split())
print(t,s,sep="")
# Judge status: Wrong Answer
N = int(input().strip())

if N<599:print(8)
elif N<799:print(7)
elif N<999:print(6)
elif N<1199:print(5)
elif N<1399:print(4)
elif N<1599:print(3)
elif N<1799:print(2)
else: print(1)
# Judge status: Accepted
inf = 1001001001
n = int(input())
lis = list(map(int, input().split()))
lis.sort()
lis.append(inf)
ans = 0
for i in range(n-2):
    a = lis[i]
    for j in range(i + 1, n-1):
        b = lis[j]
        l = j
        r = n
        while r > l+1:
            mid = (l+r) // 2
            if lis[mid] < a + b:
                l = mid
            else:
                r = mid
        ans += l - j
print(ans)
# Judge status: Wrong Answer

a,b,c = map(str,input().split())
print("YES" if int(a + b +c) % 4 == 0 else "No")
# Judge status: Wrong Answer
d,n = map(int,input().split())

print(100**d*n)
# Judge status: Accepted
K, N = list(map(int, input().split()))
A = list(map(int, input().split()))

a = K + A[0]
A = A + [a]

#print(A)

B = []
for i in range(N):
    B.append(A[i+1] - A[i])
B = sorted(B,reverse = False)

print(sum(B) - max(B))
# Judge status: Accepted
from numpy import*
f=lambda:map(int,input().split())
N,W=f()
T=zeros(W+1,int)
exec('w,v=f();T[w:]=maximum(T[w:],T[:-w]+v);'*N)
print(T[-1])
# Judge status: Accepted
l, r = map(int,input().split())
if  r - l >= 2019:
    print(0)
else:
    ans = 2019
    for i in range(l,r+1):
        for j in range(i+1,r+1):
            ans = min(ans, (i*j)%2019)
    print(ans)
# Judge status: Accepted
import sys
from collections import Counter
def input(): return sys.stdin.readline().rstrip()
def main():
    n=int(input())
    s=input()
    c_s=Counter(s)
    sum_a=0
    for diff in range(1,(n-1)//2+1):
        for i in range(n-2*diff):
            if s[i]!=s[i+diff] and s[i+diff]!=s[i+2*diff] and s[i]!=s[i+2*diff]:
                sum_a+=1
    print(c_s['R']*c_s['G']*c_s['B']-sum_a)

if __name__=='__main__':
    main()
# Judge status: Accepted
#abc127d
n,m=map(int,input().split())
a=list(map(int,input().split()))
l=[]
for i in range(m):
 bi,ci=map(int,input().split())
 l.append((ci,bi))
for i in range(n):
 l.append((a[i],1))
l=sorted(l,reverse=True)
r=n
res=0
for x in l:
 q=min(r,x[1])
 res+=q*x[0]
 r-=q
 if r==0:
  break
print(res)
# Judge status: Accepted
w,a,b = map(int, input().split())

if (a <= b <= a+w) or (a <= b+w <= a+w):
    print(0)
elif a+w < b:
    print(b-a-w)
elif b+w < a:
    print(a-b-w)
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
ans = 1
if min(a) == 0:
    print(0)
else:
    for i in range(n):
        ans *= a[i]
        if ans > 10**18:
            ans = 0
    print(ans if ans != 0 else -1)
# Judge status: Accepted

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

list=[2,3,4,5,6,7,8,9,10,11,12,13,1]
# print(list.index())

a_val=list.index(a)
b_val=list.index(b)

if a_val>b_val:print('Alice')
elif a_val<b_val:print('Bob')
else:print('Draw')
# Judge status: Accepted
A, B = input().split()
a = int(A)
if '.' in B:
    b, c = B.split('.')
    p = len(c)
    b = int(b) * 10 ** p + int(c)
else:
    b = int(B)
    p = 0

print(a * b // 10 ** p)
# Judge status: Accepted
S=str(input())

if (str(S[0])==str(S[1]) and str(S[0])==str(S[2])) or (str(S[1])==str(S[2]) and str(S[1])==str(S[3])):
	print("Yes")
else:
	print("No")
# Judge status: Wrong Answer
lst = input().split()

L = int(lst[0])
R = int(lst[1])
d = int(lst[2])

if L % d != 0:
   L = L + d - (L % d)

if R % d != 0:
   R = R - d + (R % d)

result = int(((R - L) / d) + 1)

print(result)
# Judge status: Wrong Answer
h,w = map(int,input().split())
ans = (h*w)//2
if h%2 == 1 and w%2 == 1: ans += 1
print(ans)
# Judge status: Accepted
import sys
def input():
  return sys.stdin.readline().rstrip()

N=int(input())
s=input()
t=input()

def func():
  for i in range(N):
    if s[i:]==t[0:N-i]:
      return i+N
  return N*2

print(func())