Harryxun/stf_run huggingface dataset:
s = input()
k = int(input())

edge = 0
ans = 0
if len(set(s))==1:
    s = s*k
    print(len(s)//2)
else:
    if s[0] != s[-1]:
        ans = 0
        for i in range(len(s)):
            if i==0:
                n=1
                tmp = s[i]
            elif s[i]==tmp:
                n += 1
            else:
                if n!=1:
                    ans += n//2
                tmp = s[i]
                n = 1
        print(ans*k)
        exit()
    
    a = s[0]
    b = s[-1]
    cnt_a, cnt_b = 0,0
    ite = 0
    while s[cnt_a] == a:
        cnt_a += 1
    while s[len(s)-cnt_b-1] == b:
        cnt_b += 1
    
    s1 = s[:cnt_a]
    s2 = s[cnt_a:len(s)-cnt_b]
    s3 = s[len(s)-cnt_b:]
    
    A = cnt_a//2
    B = cnt_b//2    
    X = 0
    if len(set(s2))>=1:
        X = len(s2)//2
    else:
        for i in range(len(s2)):
            if i==0:
                n = 1
                tmp = s2[i]
            elif s2[i] == tmp:
                n += 1
            else:
                if n != 1:
                    X += n//2
                tmp = s2[i]
                n = 1
    C = (len(s1+s3))//2
    print(A+B+X*k+C*(k-1))
        

### FIXED CODE ###

s = input()
k = int(input())

if len(set(list(s)))==1:
    print(len(s)*k//2)

elif s[0] != s[-1]:
    cnt = 0
    for i in range(1, len(s)):
        if s[i] == s[i-1]:
            s = s[:i]+'.'+s[i+1:]
    print(s.count('.')*k)
else:
    a,b = 0,0
    c = s[0]
    rev_s = s[::-1]
    for i in range(len(s)):
        if s[i]==c:
            a += 1
        else:
            break
    for i in range(len(s)):
        if rev_s[i]==c:
            b += 1
        else:
            break
    cnt = 0
    for i in range(1, len(s)):
        if s[i] == s[i-1]:
            s = s[:i]+'.'+s[i+1:]
    print(s.count('.')*k - (a//2 + b//2 - (a+b)//2)*(k-1))
S = input()
K = int(input())


a=0
b=0
for i in range(len(S)):
    if int(S[i]) > 1:
        a=i
        b=S[i]
        break
# print(a)
# print(b)
if K< a:
    print (S[a])
    
else:
    print (b)
    
else:
    print (b)

### FIXED CODE ###

S = input()
K = int(input())

for i in range(K):
    if S[i] != "1":
        print(S[i])
        break
else:
    print("1")
N = int(input())
A = [int(i) for i in input().split()]
B=[]*N
for i in range(N):
  B[A[i]]=i+1

ans=''
for i in range(N-1):
  ans = ans + str(B[i])+' '
ans = ans + str(B[N-1])
print(ans)

### FIXED CODE ###

N = int(input())
A = [int(i) for i in input().split()]
B=[0]*N
for i in range(N):
  B[A[i]-1]=i+1
print(*B)
n = int(input())
l = input().split()
l = set(l)
length = len(l)

if length == 4:
    print("Four")
else:
    print("Three")

### FIXED CODE ###

print(int(input())//3)
N = int(raw_input().split())
if N <= 999:
 print "ABC"
else:
 print "ABD"

### FIXED CODE ###

N = int(raw_input())
if N <= 999:
 print "ABC"
else:
 print "ABD"
while True:
    n=input()
    if n==0: break
    print ans(input() for i in range(n/4))

### FIXED CODE ###

while True:
    n = input()
    if n == 0: break
    print sum(input() for i in range(n/4))
a, b = map(int, raw_input().split())
if a == b:
    print 'H'
else:
    print 'D'

### FIXED CODE ###

a, b = map(str, raw_input().split())

if a == b:
    print 'H'
else:
    print 'D'
a = input()
n = len(a)
if (int(a[n-1])==3):
  print(bon)
if (int(a[n-1]) in [0,1,6,8] ):
  print(pon)
if (int(a[n-1]) in [2,4,5,7,9] ):
  print(hon)

### FIXED CODE ###

a = input()
n = len(a)
if (int(a[n-1])==3):
  print("bon")
elif(int(a[n-1]) in [0,1,6,8]):
  print("pon")
elif(int(a[n-1]) in [2,4,5,7,9]):
  print("hon")
# import time

# starttime=time.clock()

A,B,C =input().split()
a=int(A)
b=int(B)
c=int(C)
print(a+c)
 
if a>b:
    temp = a
    a = b
    b = temp
if b>c:
    temp = b
    b = c
    c = temp
if (a+b)==c:
    print("Yes")
#     endtime = time.clock()
#     print(endtime-starttime)
else:
    print("No")
#     endtime = time.clock()
#     print(endtime-starttime)
#      


### FIXED CODE ###

# import time

# starttime=time.clock()

A,B,C =input().split()
a=int(A)
b=int(B)
c=int(C)
# print(a+c)
 
if a>b:
    temp = a
    a = b
    b = temp
if b>c:
    temp = b
    b = c
    c = temp
if (a+b)==c:
    print("Yes")
#     endtime = time.clock()
#     print(endtime-starttime)
else:
    print("No")
#     endtime = time.clock()
#     print(endtime-starttime)
#
k = int(input())
a = str(input())

if len(a) <= k:
	print(a)
else
	print(a[:k] + "...")

### FIXED CODE ###

k = int(input())
a = str(input())
 
if len(a) <= k:
	print(a)
else:
	print(a[:k] + "...")
N ,K = map(int,inpuit())
print(N%K)

### FIXED CODE ###

N ,K = map(int,input().split())
if N%K == 0:
  print(0)
else:
  print(1)
S=list(map(int,list(input())))
def manyformulas(s):
    if len(s)==1:
        return s[0]
    return s[0]*2**(len(s)-2)+manyformulas(s[1:])+manyformulas([s[0]*10+s[1], *s[2:]])
print(manyformulas(S))

### FIXED CODE ###

S=list(map(int,list(input())))
def manyformulas(s):
    if len(s)==1:
        return s[0]
    return s[0]*2**(len(s)-2)+manyformulas(s[1:])+manyformulas([s[0]*10+s[1]]+s[2:])
print(manyformulas(S))
N = int(input())
s = input()
t = input()

for i in range(1, N):
    if s[i:] == t[:-i]:
        k = N - i
        break

if s == t:
    print(N)
else:
    print(2 * N - k)

### FIXED CODE ###

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

k = 0
for i in range(1, N):
    if s[i:] == t[:-i]:
        k = N - i
        break

if s == t:
    print(N)
else:
    print(2 * N - k)
import sys
N=int(input())
ans=[]
for i in range(int(N**0.5)-1,N+1):
    if N%i==0:
        a=str(i)
        print(len(a))
        break

### FIXED CODE ###

import sys
N=int(input())
ans=[]
if N==1:
    print(1)
    sys.exit()

for i in range(int(N**0.5),0,-1):
    if N%i==0:
        a=str(N//i)
        print(len(a))
        sys.exit()
import math
n=int(raw_input())
for i in range(n):
    x1,y1,x2,y2,x3,y3=[float(i) for i in raw_input().split()]
    t1=x1*(x2+x3-x1)+y1*(y2+y3-y1)
    t2=x2*(x1+x3-x2)+y2*(y1+y3-y2)
    t3=x3*(x1+x2-x3)+y3*(y1+y2-y3)
    px=(t1*x1+t2*x2+t3*x3)/(t1+t2+t3)
    py=(t1*y1+t2*y2+t3*y3)/(t1+t2+t3)
    r=math.hypot(px-x1,py-y1)
    print("{0} {1} {2}".format(round(px,3),round(py,3),round(r,3)))


### FIXED CODE ###

import math
n=int(input())
for i in range(n):
    x1,y1,x2,y2,x3,y3=[float(i) for i in input().split()]
    A=math.hypot(x2-x3,y2-y3)**2
    B=math.hypot(x1-x3,y1-y3)**2
    C=math.hypot(x1-x2,y1-y2)**2
    t1=A*(B+C-A)
    t2=B*(A+C-B)
    t3=C*(A+B-C)
    px=(t1*x1+t2*x2+t3*x3)/(t1+t2+t3)
    py=(t1*y1+t2*y2+t3*y3)/(t1+t2+t3)
    r=math.hypot(px-x1,py-y1)
    print("%.3f %.3f %.3f"%(round(px,3),round(py,3),round(r,3)))
a,b,c = map(int,input().split())

if (a==b && a!=c) || (a==c&&a!=b) ||(b==c&&b!=a):
    print('Yes')
else:
    print('No')

### FIXED CODE ###

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

if (a==b and a!=c) or (a==c and a!=b) or (b==c and b!=a):
    print('Yes')
else:
    print('No')
def fizz_buzz():
    c = 1
    while True:
        res = ''
        if c % 3 == 0:
            res = res + 'Fizz'
        if c % 5 == 0:
            res = res + 'Buzz'
        if res == '':
            yield str(c)
        else:
            yield res
        c += 1

while True:
    m,n = map(int,input().split())
    if m == 0: break

    player = list(range(m))

    p = 0
    fb = fizz_buzz()
    for i in range(n):
        inp = input()
        if len(player) > 1:
            if  inp != next(fb):
                del player[p] 
            else:
                p = (p+1) % len(player)

    result = str(player[0]+1)
    for pi in player[1:]:
        result += ' ' + str(pi+1)

    print(result)

### FIXED CODE ###

def fizz_buzz():
    c = 1
    while True:
        res = ''
        if c % 3 == 0:
            res = res + 'Fizz'
        if c % 5 == 0:
            res = res + 'Buzz'
        if res == '':
            yield str(c)
        else:
            yield res
        c += 1

while True:
    m,n = map(int,input().split())
    if m == 0: break

    player = list(range(m))

    p = 0
    fb = fizz_buzz()
    for i in range(n):
        inp = input()
        if len(player) > 1:
            if  inp != next(fb):
                del player[p] 
                p = p % len(player)
            else:
                p = (p+1) % len(player)

    result = str(player[0]+1)
    if len(player) > 1:
        for pi in player[1:]:
            result += ' ' + str(pi+1)

    print(result)
s = input()
s.split()
odd = []

for i in range():
    if i % 2 == 0:
        odd.append(s[i])
answer = ''.join(odd)

print(answer)

### FIXED CODE ###

s = input()
s.split()
odd = []

for i in range(len(s)):
    if i % 2 == 0:
        odd.append(s[i])
answer = ''.join(odd)

print(answer)
n-int(input())
x=list(map(int,input().split()))
a=0
b=0
for i in range(n//2):
  a+=max(x)
  x.remove(max(x))
  b+=max(x)
  x.remove(max(x))

if n%2:
  a+=x[0]
dif=b-a
print(dif)

### FIXED CODE ###

n=int(input())
x=list(map(int,input().split()))
a=0
b=0
for i in range(n//2):
  a+=max(x)
  x.remove(max(x))
  b+=max(x)
  x.remove(max(x))

if n%2:
  a+=x[0]
dif=a-b
print(dif)
N, K = map(int, input().split())
A = [int(x) for x in input().split()]
A.sort()
res = 0
MOD = 10**9+7
nCk_2 = dict()
def fact(n, k=1):
    if n == 0:
        return 1
    if n <= k:
        return 1
    return n*fact(n-1)%MOD
def comb(n, k):
    return (fact(n)//(fact(n-k)*fact(k)))%MOD
s = [1,-1]
for m in range(2):
    for i in range(K-1,N):
        res = (res + s[m]*int((A[i])*comb(i,K-1)))%MOD
    A = sorted(A, reverse=True)
print(res)


### FIXED CODE ###

N, K = map(int, input().split())
A = [int(x) for x in input().split()]
A.sort()
res = 0
MOD = 10**9+7
nCk_2 = dict()
fac, finv, inv = [0]*(N+1), [0]*(N+1), [0]*(N+1)
fac[0] = fac[1] = 1
finv[0] = finv[1] = 1
inv[1] = 1
for i in range(2,N+1):
    fac[i] = fac[i-1]*i%MOD
    inv[i] = MOD-inv[MOD%i]*(MOD//i)%MOD
    finv[i] = finv[i-1]*inv[i]%MOD
def comb(n, k):
    return (fac[n]*((finv[k]*finv[n-k])%MOD))%MOD
s = [1,-1]
for m in range(2):
    for i in range(K-1,N):
        res = (res + s[m]*int((A[i])*comb(i,K-1)))%MOD
    A = sorted(A, reverse=True)
print(res)
k = int(input())
L = []

def lunlun(d,v,L):
    L.append(v)
    if d == 4:
        return
    for i in range(-1,2):
        t = v%10 + i
        #print(v)
        if 0 <= t <=9:
            lunlun(d+1,v*10+t,L)
#lunlun(1,1,L)
for v in range(1,10):
    lunlun(1,v,L)
print(sorted(L)[k-1])

### FIXED CODE ###

k = int(input())
L = [1,2,3,4,5,6,7,8,9]
i = 0
while i < k:
    if int(str(L[i])[-1]) == 0:
        n2 = L[i]*10 + L[i]%10
        n3 = L[i]*10 + L[i]%10 +1
        L.append(n2)
        L.append(n3)
    elif 1 <= int(str(L[i])[-1]) <= 8:
        n1 = L[i]*10 + L[i]%10 -1
        n2 = L[i]*10 + L[i]%10
        n3 = L[i]*10 + L[i]%10 +1
        L.append(n1)
        L.append(n2)
        L.append(n3)
    elif int(str(L[i])[-1]) == 9:
        n1 = L[i]*10 + L[i]%10 -1
        n2 = L[i]*10 + L[i]%10
        L.append(n1)
        L.append(n2)
    i +=1

print(L[k-1])
if len(set(list(map(int, input())))) == 2:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

if len(set(list(map(int, input().split())))) == 2:
  print("Yes")
else:
  print("No")
X,Y,Z,K = map(int, input().split())


A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
D = []
E2 = []
F = []

# A + Bの全列挙 からのソート 

for i in A : 
    for j in B : 
        D.append(i+j)
        
E = sorted(D, reverse = True)

if len(E) > K : 
    for i in range(K) : 
        E2.append(E[i])
else : 
    E2 = E
        
####

for i in E2 : 
    for j in C : 
        F.append(i+j)
        
G = sorted(F, reverse = True)

for i in range(K) : 
    print(G[i])

### FIXED CODE ###

import itertools as itr

antenna = []

s = 0

for _ in range(5) : 
    antenna.append(int(input()))
    
k = int(input())

l = list(itr.combinations(antenna, 2))

for i in l : 
    if (abs(i[0] -i[1])) > k :
        s = 1

if (s == 0) : 
    print("Yay!")
else : 
    print(":(")
'''
    Auther: ghoshashis545 Ashis Ghosh
    College: jalpaiguri Govt Enggineering College

'''
from os import path
import sys
from functools import cmp_to_key as ctk
from collections import deque,defaultdict as dd 
from bisect import bisect,bisect_left,bisect_right,insort,insort_left,insort_right
from itertools import permutations
from datetime import datetime
from math import ceil,sqrt,log,gcd
def ii():return int(input())
def si():return input()
def mi():return map(int,input().split())
def li():return list(mi())
abc='abcdefghijklmnopqrstuvwxyz'
mod=1000000007
#mod=998244353
inf = float("inf")
vow=['a','e','i','o','u']
dx,dy=[-1,1,0,0],[0,0,1,-1]

def bo(i):
    return ord(i)-ord('a')

file = 1

def solve():
    



    # for _ in range(ii()):

    n=ii()
    m={}
    a=["AC","WA","TLE","RE"]
    m['WA']=0
    m['TLE']=0
    m["AC"]=0
    m["RE"]=0
    for i in range(n):
        s=si()
        m[s]+=1
    for i in a:
        print(i,end=" x ")
        print(m[i])












  
















if __name__ =="__main__":

    if(file):

        if path.exists('input1.txt'):
            sys.stdin=open('input1.txt', 'r')
            sys.stdout=open('output1.txt','w')
        else:
            input=sys.stdin.readline
    solve()

### FIXED CODE ###

'''
    Auther: ghoshashis545 Ashis Ghosh
    College: jalpaiguri Govt Enggineering College

'''
from os import path
import sys
from functools import cmp_to_key as ctk
from collections import deque,defaultdict as dd 
from bisect import bisect,bisect_left,bisect_right,insort,insort_left,insort_right
from itertools import permutations
from datetime import datetime
from math import ceil,sqrt,log,gcd
def ii():return int(input())
def si():return input()
def mi():return map(int,input().split())
def li():return list(mi())
abc='abcdefghijklmnopqrstuvwxyz'
mod=1000000007
#mod=998244353
inf = float("inf")
vow=['a','e','i','o','u']
dx,dy=[-1,1,0,0],[0,0,1,-1]

def bo(i):
    return ord(i)-ord('a')

file = 0

def solve():
    



    # for _ in range(ii()):

    n=ii()
    m={}
    a=["AC","WA","TLE","RE"]
    m['WA']=0
    m['TLE']=0
    m["AC"]=0
    m["RE"]=0
    for i in range(n):
        s=si()
        m[s]+=1
    for i in a:
        print(i,end=" x ")
        print(m[i])












  
















if __name__ =="__main__":

    if(file):

        if path.exists('input1.txt'):
            sys.stdin=open('input1.txt', 'r')
            sys.stdout=open('output1.txt','w')
        else:
            input=sys.stdin.readline
    solve()
h, w = map(int, input().split())
s = [input() for _ in range(h)]
dx = [-1, 0, 0, 1]
dy = [0, -1, 1, 0]
for i in range(h):
    for j in range(w):
        if s[i][j] == '#':
            flag = 0
            for k in range(4):
                nx = i + dx[k]
                ny = j + dy[k]
                if nx < 0 or w <= nx:
                    continue
                if ny < 0 or h <= ny:
                    continue
                if s[nx][ny] == '#':
                    flag = 1
            if flag == 0:
                print('No')
                exit()
else:
    print('Yes')


### FIXED CODE ###

h, w = map(int, input().split())
s = [input() for _ in range(h)]
dx = [-1, 0, 0, 1]
dy = [0, -1, 1, 0]
for i in range(h):
    for j in range(w):
        if s[i][j] == '#':
            flag = 0
            for k in range(4):
                ny = i + dy[k]
                nx = j + dx[k]
                if nx < 0 or w <= nx:
                    continue
                if ny < 0 or h <= ny:
                    continue
                if s[ny][nx] == '#':
                    flag = 1
            if flag == 0:
                print('No')
                exit()
else:
    print('Yes')
N = int(input())
color = [0]*8
free = 0
for _ in range(N):
    a  = int(input())
    if 1<=a<=399:
        color[0] = 1
    elif 400<=a<=799:
        color += 1
    elif 800<=a<=1199:
        color += 1
    elif 1200<=a<=1599:
        color += 1
    elif 1600<=a<=1999:
        color += 1
    elif 2000<=a<=2399:
        color += 1
    elif 2400<=a<=2799:
        color += 1
    elif 2800<=a<=3199:
        color += 1
    else:
        free += 1
maxcolor = sum(color)+free
mincolor = sum(color)
print(mincolor,maxcolor)

### FIXED CODE ###

N = int(input())
color = [0]*8
free = 0
A = list(map(int,input().split()))
for a in A:
    if 1<=a<=399:
        color[0] = 1
    elif 400<=a<=799:
        color[1] = 1
    elif 800<=a<=1199:
        color[2] = 1
    elif 1200<=a<=1599:
        color[3] = 1
    elif 1600<=a<=1999:
        color[4] = 1
    elif 2000<=a<=2399:
        color[5] = 1
    elif 2400<=a<=2799:
        color[6] = 1
    elif 2800<=a<=3199:
        color[7] = 1
    else:
        free += 1
maxcolor = sum(color)+free
mincolor = max(sum(color),1)
print(mincolor,maxcolor)
#! env python
# -*- coding: utf-8 -*-

import os
import sys

# at_coder.ABC086C_Traveling
# Date: 2019/06/02
# Filename: ABC086C_Traveling 

__author__ = 'acto_mini'
__date__ = "2019/06/02"


dict = [
    [1, 1, 0],
    [1, 0, 1],
    [1, -1, 0],
    [1, 0, -1]
]

def route (dis, current, goal):

    if dis < 0:
        return False

    new_current = [0, 0, 0]

    for d in dict:
        new_current[0] = current[0] + d[0]
        new_current[1] = current[1] + d[1]
        new_current[2] = current[2] + d[2]

        if goal[0] == new_current[0] and goal[1] == new_current[1] and goal[2] == new_current[2]:
            return True

        if route(dis-1, new_current, goal):
            return True

    return False

def main():
    # 作業ディレクトリを自身のファイルのディレクトリに変更
    os.chdir(os.path.dirname(os.path.abspath(sys.argv[0])))

    current = [0, 0, 0]

    # 整数の入力
    num = int(input())
    goal_list = []

    for i in range(num):
        t, x, y = map(int, input().split())
        goal_list.append([t, x, y])

    fail = False
    for i in range(num):

        t, x, y = goal_list[i][0], goal_list[i][1], goal_list[i][2]

        if route(dis=t, current=current, goal=[t, x, y]):
            current = [t, x, y]
            continue

        fail = True
        break

    if fail:
        print("No")
    else:
        print("Yes")

    return

if __name__ == '__main__':
    main()


### FIXED CODE ###

#! env python
# -*- coding: utf-8 -*-

import os
import sys

# at_coder.ABC086C_Traveling
# Date: 2019/06/02
# Filename: ABC086C_Traveling 

__author__ = 'acto_mini'
__date__ = "2019/06/02"


def main():
    # 作業ディレクトリを自身のファイルのディレクトリに変更
    os.chdir(os.path.dirname(os.path.abspath(sys.argv[0])))

    t, x, y = [0], [0], [0]

    # 整数の入力
    num = int(input())

    for i in range(num):
        a, b, c = map(int, input().split())
        t.append(a)
        x.append(b)
        y.append(c)

    can = True
    for i in range(num):
        dt = t[i + 1] - t[i]
        dist = abs(x[i + 1] - x[i]) + abs(y[i + 1] - y[i])
        if (dt < dist):
            can = False
        if (dt % 2 != dist % 2):
            can = False

    if can:
        print("Yes")
    else:
        print("No")

    return


if __name__ == '__main__':
    main()
A,B =map(int.input().split())
print(A*B)


### FIXED CODE ###

A,B =input().split()
a=int(A)
b=int(B)
print(a*b)
a,b=map(int,input().split())
A=list(map(int,input().split()))
 
S=sum(A)
ans=0
for i in range(a):
    if A[i]>=S/(4*b):
        ans+=1
if ans>=b:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

n, k = map(int, input().split())
 
ans = min(n % k, abs(n % k - k))
print(ans)
N=int(input())
l=[0 for _ in range(N)]
for _ in range(N):
  l[int(input())]=1
print(sum(l))

### FIXED CODE ###

N=int(input())
l=[0 for _ in range(100)]
for _ in range(N):
  l[int(input())-1]=1
print(sum(l))
n=int(input())
s=input()
t=input()

for i in range(n,2*n-1):
    if s[:2*n-i] == t[2*n-i]:
        print(i)
        exit()
print(2*n)

### FIXED CODE ###

n=int(input())
s=input()
t=input()

for i in range(n+1):
    #print(s[i:],t[:n-i])
    if s[i:] == t[:n-i]:
        print(n+i)
        exit()
a,b = int(input())
if a>b:
  print(2*a-1)
elif a<b:
  print(2*b-1)
else:
  print(2*a)

### FIXED CODE ###

a,b = map(int,input().split())
if a>b:
  print(2*a-1)
elif a<b:
  print(2*b-1)
else:
  print(2*a)
a = list(input())
b = len(a)
c = int(b/2)
result = []
if b%2 == 0:
    A = a[:c]
    B = a[c:]
    BB = B[::-1]
    for v in range(c):
        if A[v] != BB[v]:
            result.append(v)
        else:
            x.append(v)
        
else:
    C = a[:c]
    D = a[c+1:]
    DD = D[::-1]
    for v in range(c):
        if C[v] != DD[v]:
            result.append(v)
        else:
            x.append(v)
print(len(result))

### FIXED CODE ###

a = list(input())
b = len(a)
c = int(b/2)
x = []
result = []
if b%2 == 0:
    A = a[:c]
    B = a[c:]
    BB = B[::-1]
    for v in range(c):
        if A[v] != BB[v]:
            result.append(v)
        else:
            x.append(v)
        
else:
    C = a[:c]
    D = a[c+1:]
    DD = D[::-1]
    for v in range(c):
        if C[v] != DD[v]:
            result.append(v)
        else:
            x.append(v)
print(len(result))
import sys
input = sys.stdin.readline
N=int(input())
h = [int(input()) for _ in range(N)]
dp=[0]+[abs(h[1]-h[0])]+[10001]*(N-2)

for i in range(2,N):
    dp[i]=min(
        dp[i-1]+abs((h[i]-h[i-1])),
        dp[i-2]+abs((h[i]-h[i-2]))
    )

print(dp[-1])

### FIXED CODE ###

import sys
input = sys.stdin.readline
N=int(input())
h = list(map(int, input().split()))#[int(input()) for _ in range(N)]
dp=[0]+[abs(h[1]-h[0])]+[10001]*(N-2)

for i in range(2,N):
    dp[i]=min(
        dp[i-1]+abs((h[i]-h[i-1])),
        dp[i-2]+abs((h[i]-h[i-2]))
    )

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

if x >= 1800:
    ans = 1
elif x >= 1600:
    ans = 2
elif x >= 1400:
    ans = 3
elif x >= 1200:
    ans = 4
elif x >= 1000:
    ans = 5
elif x >= 800:
    ans = 6
elif x >= 600:
    ans = 7
else:
    x = 8

print(str(int(ans)))

### FIXED CODE ###

x = int(input())

if x >= 1800:
    ans = 1
elif x >= 1600:
    ans = 2
elif x >= 1400:
    ans = 3
elif x >= 1200:
    ans = 4
elif x >= 1000:
    ans = 5
elif x >= 800:
    ans = 6
elif x >= 600:
    ans = 7
else:
    ans = 8

print(str(int(ans)))
N = int(input())
h = list(map(int, input().split()))
a = list(map(int, input().split()))

import math

num = 2**(int(math.log2(N+1))+1)
seg = [0]*(2*num-1)

#update(i,x):Aiをxに更新する
def update(i,x):
    k = i + num - 1
    while k >= 0:
        seg[k] = max(x,seg[k])
        k = (k-1)//2

#query(a,b,0,0,num):[a,b)の最大値
def query(a,b,k,l,r):
    if r <= a or b <= l:
        return -float("inf")
    elif a <= l and r <= b:
        return seg[k]
    else:
        return max(query(a,b,2*k+1,l,(l+r)//2),query(a,b,2*k+2,(l+r)//2,r))


for i in range(N):
    update(h[i], query(0,h[i],0,0,num) + a[i])

print(max(seg))

### FIXED CODE ###

N = int(input())
h = list(map(int, input().split()))
a = list(map(int, input().split()))

num = 2
while num <= N+1:
    num *= 2

seg = [0]*(2*num-1)

#update(i,x):Aiをxに更新する
def update(i,x):
    k = i + num - 1
    while k >= 0:
        seg[k] = max(x,seg[k])
        k = (k-1)//2

#query(a,b,0,0,num):[a,b)の最大値
def query(a,b,k,l,r):
    if r <= a or b <= l:
        return -1
    elif a <= l and r <= b:
        return seg[k]
    else:
        return max(query(a,b,2*k+1,l,(l+r)//2),query(a,b,2*k+2,(l+r)//2,r))


for i in range(N):
    update(h[i], query(0,h[i],0,0,num) + a[i])

print(max(seg))