Harryxun/stf_run huggingface dataset:
in_ = input()
n, k = in_.split()
if (1 <= (n - 1) / k):
  print("YES")
else:
  print("NO")

### FIXED CODE ###

in_ = input()
n, k = map(int, in_.split())

if (k == 1):
    print("YES")
    exit()

if ((n % 2) == 1):
    n += 1

if (2 <= (n / k)):
    print("YES")
else:
    print("NO")
#!/usr/bin/env python3
import sys


def solve(H: int, N: int, A: "List[int]", B: "List[int]"):
    nodes = {0: 0}
    fixed = 0
    unfixed = set()
    while True:
        cost = nodes[fixed]
        for a, b in zip(A,B):
            new_node = fixed + a
            last = nodes.get(new_node, 999999)
            new_cost = cost + b
            if last > new_cost:
                nodes[new_node] = new_cost
                unfixed.add(new_node)
        fixed = min(unfixed)
        unfixed.remove(fixed)
        if fixed >= H:
            break
    print(min([v for k, v in nodes.items() if k >= H]))

# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    H = int(next(tokens))  # type: int
    N = int(next(tokens))  # type: int
    A = [int()] * (N)  # type: "List[int]"
    B = [int()] * (N)  # type: "List[int]"
    for i in range(N):
        A[i] = int(next(tokens))
        B[i] = int(next(tokens))
    solve(H, N, A, B)

if __name__ == '__main__':
    main()


### FIXED CODE ###

#!/usr/bin/env python3
import sys


def solve(H: int, N: int, A: "List[int]", B: "List[int]"):
    nodes = {0: 0}
    fixed = 0
    unfixed = set()
    while True:
        cost = nodes[fixed]
        for a, b in zip(A,B):
            new_node = fixed + a
            last = nodes.get(new_node, 999999999)
            new_cost = cost + b
            if last > new_cost:
                nodes[new_node] = new_cost
                unfixed.add(new_node)
        fixed = min(unfixed)
        if fixed >= H:
            break
        unfixed.remove(fixed)
    print(min([v for k, v in nodes.items() if k >= H]))

# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    H = int(next(tokens))  # type: int
    N = int(next(tokens))  # type: int
    A = [int()] * (N)  # type: "List[int]"
    B = [int()] * (N)  # type: "List[int]"
    for i in range(N):
        A[i] = int(next(tokens))
        B[i] = int(next(tokens))
    solve(H, N, A, B)

if __name__ == '__main__':
    main()
# -*- coding:utf8 -*-
import math

n = int(input())
s = [input() for _ in range(n)]
s = [''.join(sorted(i)) for i in s]
c = [math.factorial(s.count(i)) for i in set(s) if s.count(i) != 1]
ans = 0 if not c else sum(c)/2 
print(ans)

### FIXED CODE ###

# -*- coding:utf8 -*-
import collections

n = int(input())
s = [input() for _ in range(n)]
s = [''.join(sorted(i)) for i in s]
c = collections.Counter(s)
t = [range(i) for i in list(c.values()) if i != 1]
a = [sum(i) for i in t]
print(sum(a))
n= int(input())
a=list(map(int, input().split()))
ans=0
a.sort(reverse=True)
for i in range(n):
    if a[i]:
        bi=format(a[i], 'b')
        x=2**len(bi)-a[i]
        if a[i]==x and a[i+1]==x:
            ans+=1
            a[i]=None
            a[a.index(x)]=None
        elif x in a and x!=a[i]:
            ans+=1
            a[a.index(x)]=None
            a[i]=None
print(ans)

### FIXED CODE ###

import collections
import bisect
n= int(input())
a=list(map(int, input().split()))
c=collections.Counter(a)
ans=0
des=sorted(a,reverse=True)
# asc=sorted(a)

for i in des:
    if c[i]>0:
        bi=format(i, 'b')
        x=2**len(bi)-i
        c[i]-=1
        if c[x]>0:
            c[x]-=1
            ans+=1
print(ans)
h,n=map(int,input().split())
a=input()
list=a.split()
sum=0
for i in range(n-1):
    sum=sum+int(input())
#print(sum)
if sum>=h:
    print("Yes")
else:
    print("No")


### FIXED CODE ###

h,n=map(int,input().split())
a=input()
list=a.split()
sum=0
for item in list:
    sum=sum+int(item)
#print(sum)
if sum>=h:
    print("Yes")
else:
    print("No")
a,b = int(inout().split())

print(int((a + b) // 2 + 1))


### FIXED CODE ###

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

if (a + b) % 2 == 0:
  print(int((a + b)/2))
  
else:
  print(int((a + b) // 2) +1)
n, x, m = map(int, input().split())

dp = [-1]*(10**5+2)
nums = [-1]*(10**5+2)
nums[x] = 1
dp[0] = 0
dp[x] = x
bef = x
nex = (x**2)%m
r = [0, x]
while dp[nex] < 0:
    nums[nex] = nums[bef]+1
    dp[nex] = dp[bef]+nex
    r.append(dp[nex])
    nex, bef = (nex**2)%m, nex

if nex == 0:
    x = num[bef]
    if x >= n:
        print(r[n])
    else:
        print(r[-1])
else:
    roop = nums[bef] - nums[nex] + 1
    roop_value = r[nums[bef]] - r[nums[nex] - 1]
    plus = r[nums[nex]-1]*(n>=nums[nex])
    n = max(0, n-nums[nex]+1)
    print(
        roop_value*(n//roop)+plus+
        r[n%roop + nums[nex] -1]
        -r[nums[nex] - 1]
    )


### FIXED CODE ###

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

dp = [-1 for _i in range(10**5+2)]
nums = [-1 for _i in range(10**5+2)]
nums[x] = 1

dp[x] = x
bef = x
nex = (x**2)%m
r = [0, x]
while dp[nex] < 0:
    nums[nex] = nums[bef]+1
    dp[nex] = dp[bef]+nex
    r.append(dp[nex])
    nex, bef = (nex**2)%m, nex

if nex == 0:
    print(r[min(len(r)-1, n)])
elif n <= nums[bef]:
    print(r[n])
else:
    roop = nums[bef] - nums[nex] + 1
    roop_value = r[nums[bef]] - r[nums[nex] - 1]
    plus = r[nums[nex]-1]*(n>=nums[nex]+1)
    n = max(0, n-nums[nex]+1)
    print(
        roop_value*(n//roop)+plus+
        r[n%roop + nums[nex] -1]
        -r[nums[nex] - 1]
    )
N = int(input().split())

print(sum([n + 1 for n in range(N) if (n + 1) % 3 != 0 and (n + 1) % 5 != 0]))


### FIXED CODE ###

N = int(input())

print(sum([n + 1 for n in range(N) if (n + 1) % 3 != 0 and (n + 1) % 5 != 0]))
N=int(input())
A=[int(x) for x in input().strip().split(" ")]
x=1

for i in range(N):
    x *=A[i]
    
if x>pow(10,18):
    print("-1")
else:
    print(x)

### FIXED CODE ###

a,b=[float(x) for x in input().strip().split(" ")]
x=a*(b*100)/100
print(int(x))
a = int(input())
b = int(input())
add = a+b
minus = a-b
multi = a*b
print(max(add,minus, multi))

### FIXED CODE ###

d = raw_input().split()
a, b = d[0], d[1]
operators = ["+", "-", "*"]
current = None
soFar = None
for i in range(len(operators)):
    current = eval(a + operators[i] + b)
    soFar = max(current, soFar)
print(soFar)
n1=int(input())
l1=len(str(n1))
count=0
def count1(n):
  l=len(str(n))-1
  l2=int(str(n)[0])
  if int(str(n)[0])>=8:
    return 3*(3**l+3-3*(2**l))
  elif int(str(n)[0])==7:
    return count(n-7*(10**(l-1)))+2*(3**l+3-3*(2**l))
  elif l2==6:
    return 2*(3**l+3-3*(2**l))
  elif l2==5:
    return count(n-5*(10**(l-1)))+(3**l+3-3*(2**l))
  elif l2==4:
    return (3**l+3-3*(2**l))
  elif l2==3:
    return count(n-3*(10**(l-1)))
  else:
    return 0
    
    
if l1<3:
  print(0)
else:
  if l1>=4:
    for i in range(3,l1):
      c+=3**i+3-3*(2**i)
  print(c+count1(n1))
  

### FIXED CODE ###

from collections import deque
n=int(input())
l=["3","5","7"]
q=deque(["3","5","7"])
l1=["3","5","7"]
count=0
while q:
  a=q.popleft()
  for i in l:
    if int(i+a)<=n:
      q.append(i+a)
      l1.append(i+a)
for i in l1:
  if ("3" in i) and ("5" in i) and ("7" in i):
    count+=1
print(count)
S = list(input())
A = sorted(S)
if A[0] == A[1] ! A[2] == A[3]:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

S = list(input())
A = sorted(S)
if A[0] == A[1] != A[2] == A[3]:
  print("Yes")
else:
  print("No")
x, y = map(int, input().split())

a, b, c = (4, 6, 9, 11), (1, 3, 5, 7, 8, 10, 12), (2)

if x in a and y in a:
    print("Yes")
elif x in b and y in b:
    print("Yes")
elif x in c and y in c:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

x, y = map(int, input().split())

a, b, c = (4, 6, 9, 11), (1, 3, 5, 7, 8, 10, 12), (2)

if x in a and y in a:
    print("Yes")
elif x in b and y in b:
    print("Yes")
elif x == 2 and y == 2:
    print("Yes")
else:
    print("No")
l = ['P','W','G','Y']
l_ = [0,0,0,0]

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

for i in range(len(s)):
  if s[i] == 'P':
    l_[0] += 1
  elif s[i] == 'W':
    l_[1] += 1
  elif s[i] == 'G':
    l_[2] += 1
  else:
    l_[3] += 1
else:
  for i in range(4):
    if l_[i] == 0:
      print("Three")
      break
    else:
      print("Four")
      break

### FIXED CODE ###

if __name__ == "__main__":
    n = int(input())
    s = list(set(list(map(str,input().split()))))
    print("Four") if len(s) == 4 else print("Three")
a, b, c, k = map(int, input().split())
A = [1]*a
B = [0]*b
C = [-1]*c
K = A+B+C
print(sum(K[0:k]))

### FIXED CODE ###

a, b, c, k = map(int, input().split())
if k <= a:
    print(k)
elif a < k <= a+b:
    print(a)
elif a+b <= k:
    print(a-(k-a-b))
a, b, c, k = map(int, input().split())
s = 0
for in range(k):
  if a > 0:
    s += 1
    a -= 1
  elif b > 0:
    b += 0
  else:
    s += -1
print(s)

### FIXED CODE ###

# coding: UTF-8
import sys
#sys.setrecursionlimit(n)
import heapq
import re
import bisect
import random
import math
import itertools
from collections import defaultdict, deque
from copy import deepcopy
from decimal import *

readl= lambda: list(map(int, sys.stdin.readline().split()))
readt= lambda: tuple(map(int, sys.stdin.readline().split()))
read = lambda: sys.stdin.readline().rstrip()
readi = lambda: int(read())
readmi = lambda: map(int, sys.stdin.readline().split())
readms = lambda: map(str, sys.stdin.readline().split())

a, b, c, k = readmi()
s = min(a, k)
k -= a
if k <= 0:
    print(s)
    exit()
k -= b
if k <= 0:
    print(s)
    exit()
s -= k
print(s)
# -*- coding: utf-8 -*-

s = input()

double = []
triple = []

for i in range(len(s)-1):
    if s[i] == s[i+1]:
        double = [str(i+1), str(i+2)]
    if s[i] == s[i+1] == s[i+2]:
        triple = [str(i+1), str(i+3)]
        
if double:
    print(' '.join(double))
elif triple:
    print(' '.join(triple))
else:
    print('-1 -1')
    

### FIXED CODE ###

# -*- coding: utf-8 -*-

s = input()

ans = ''

for i in range(len(s)-1):
    if s[i] == s[i+1]:
        ans = ' '.join([str(i+1), str(i+2)])
for j in range(len(s)-2):
    if s[j] == s[j+2]:
        ans = ' '.join([str(j+1), str(j+3)])

if ans:
    print(ans)
else:
    print('-1 -1')
A,B,H,M = map(int, input().split())

import math

degreeA = (H * 60 + M) / 2
degreeB = M * 6

if degreeA == degreeB:
    print(abs(A - B))
else:
    degreeAB = abs(degreeA - degreeB)
    if degreeAB == 180:
        print(A + B)
    elif degreeAB > 180:
        degreeAB = 360 - degreeAB
    C = A ** 2 + B ** 2 - 2 * A * B * math.cos(degreeAB * math.pi / 180)
    print(math.sqrt(C))
            

### FIXED CODE ###

N = input()


if int(N[len(N)-1]) in [2 , 4 , 5 ,7 , 9]:
    print("hon")
elif int(N[len(N)-1]) in [0,1,6,8]:
    print("pon")
else:
    print("bon")
x = int(input())
y = int(input())
if x ==y :
    print(y)
else:
    print(y-x+1)

### FIXED CODE ###

t,i = map(int,input().split(" "))
j=t-i+1 
print(j)
print("NYoe s"[int(input().replace(" ",""))**0.5.isinteger()::2])

### FIXED CODE ###

print("NYoe s"[int(input().replace(" ",""))**0.5%1==0::2])
import sys


P = int(sys.argv[1]) 
Q = int(sys.argv[2]) 
R = int(sys.argv[3]) 
 
a1 = P + Q.
a2 = P + R
a3 = Q + R

value = 300

if __name__ == '__main__':
    if a1 < value:
        value = a1
    if value > a2:
        value = a2
    if value > a3:
        value = a3
    print(value) 


### FIXED CODE ###

P,Q,R = map(int,input().split())
a1 = P + Q
a2 = P + R
a3 = Q + R
value = 300
if a1 < value:
    value = a1
if value > a2:
    value = a2
if value > a3:
    value = a3
print(value)
S = str(input())
T = str(input())

print(T + S)

### FIXED CODE ###

S ,T = input().split()

print(T,S,sep="")
while 1:
    h,w = map(int, raw_input().split())

    if h == 0 nad w == 0:
    break

    for i in range(h):
        if i == 0 or i == (h-1):
            print "#" * w
        else :
            print "#" + "." *(w-2)+"#"
        print ""

### FIXED CODE ###

while(True):
    H, W = map(int, raw_input().split())
    if(H == 0 and W == 0):
        break
    for i in range(H):
        if(i == 0 or i == (H - 1)):
            print("#" * W)
        else:
            print("#" + "." * (W - 2) + "#")
    print("")
*a,=open(0);n,a=map(int,a);print(sum(a[0::2])-sum(a[1::2]))

### FIXED CODE ###

input();a=sorted(map(int,input().split()))[::-1];print(sum(a[::2])-sum(a[1::2]))
class Dice2():
    def front(self,up,front,dice):
        #index == 5
        if (up==dice[2] and front==dice[1])
        or(up==dice[1] and front==dice[3])
        or(up==dice[3] and front==dice[4])
        or(up==dice[4] and front==dice[2]):
            return dice[5]
        #index == 4
        elif (up==dice[0] and front==dice[2])
        or(up==dice[2] and front==dice[5])
        or(up==dice[5] and front==dice[3])
        or(up==dice[3] and front==dice[0]):
            return dice[4]
        #index == 3
        elif (front==dice[5] and up==dice[4])
        or(front==dice[4] and up==dice[0])
        or(front==dice[0] and up==dice[1])
        or(front==dice[1] and up==dice[5]):
            return dice[3]
        #index == 2
        elif (up==dice[5] and front==dice[4])
        or(up==dice[4] and front==dice[0])
        or(up==dice[0] and front==dice[1])
        or(up==dice[1] and front==dice[5]):
            return dice[2]
        #index == 1
        elif (front==dice[0] and up==dice[2])
        or(front==dice[2] and up==dice[5])
        or(front==dice[5] and up==dice[3])
        or(front==dice[3] and up==dice[0]):
            return dice[1]
        #index == 0
        else:
            return dice[0]

dice = [int(i) for i in input().split()]
p = int(input())
dc2 = Dice2()
ans = []
for i in range(p):
    up,front = map(int,input().split())
    ans.append(dc2.front(up,front,dice))
for i in range(p):
    print(ans[i])


### FIXED CODE ###

class Dice2():
    def front(self,up,front,dice):
        #index == 5
        if(up==dice[2] and front==dice[1])or(up==dice[1] and front==dice[3])or(up==dice[3] and front==dice[4])or(up==dice[4] and front==dice[2]):
            return dice[5]
        #index == 4
        elif(up==dice[0] and front==dice[2])or(up==dice[2] and front==dice[5])or(up==dice[5] and front==dice[3])or(up==dice[3] and front==dice[0]):
            return dice[4]
        #index == 3
        elif(front==dice[5] and up==dice[4])or(front==dice[4] and up==dice[0])or(front==dice[0] and up==dice[1])or(front==dice[1] and up==dice[5]):
            return dice[3]
        #index == 2
        elif(up==dice[5] and front==dice[4])or(up==dice[4] and front==dice[0])or(up==dice[0] and front==dice[1])or(up==dice[1] and front==dice[5]):
            return dice[2]
        #index == 1
        elif(front==dice[0] and up==dice[2])or(front==dice[2] and up==dice[5])or(front==dice[5] and up==dice[3])or(front==dice[3] and up==dice[0]):
            return dice[1]
        #index == 0
        else:
            return dice[0]

dice = [int(i) for i in input().split()]
p = int(input())
dc2 = Dice2()
ans = []
for i in range(p):
    up,front = map(int,input().split())
    ans.append(dc2.front(up,front,dice))
for i in range(p):
    print(ans[i])
xy=[(1,0),(-1,0),(0,1),(0,-1)]

h,w=map(int,input().split())
l=[]
for i in range(h):
    l.appned(input())
for i in range(h):
    for j in range(w):
        if l[i][j]=="#":
            f=0
            for x,y in xy:
                if 0<=(i+y)<h and 0<=(j+x)<w l[i+y][j+x]=="#": f=1
            if f==0:
                print("No")
                exit()
                

print("Yes")


### FIXED CODE ###

xy=[(1,0),(-1,0),(0,1),(0,-1)]

h,w=map(int,input().split())
l=[]
for i in range(h):
    l.append(input())
for i in range(h):
    for j in range(w):
        if l[i][j]=="#":
            f=0
            for x,y in xy:
                if 0<=(i+y)<h and 0<=(j+x)<w and l[i+y][j+x]=="#": f=1
            if f==0:
                print("No")
                exit()
                

print("Yes")
a, b, c = map(int, input().split())
if set(a, b, c) == (5, 7) & a*b*c % 25 == 0:
  print(YES)
else:
  print(NO)

### FIXED CODE ###

a, b, c = map(int, input().split())
if sorted((a, b, c)) == [5, 5, 7]:
  print('YES')
else:
  print('NO')
*a, = map(int, input().split())
if a[0] == a[1]:
    print("EQUAL")
else:
    print("GREATER" if a[0] > a[1] else "LESS")


### FIXED CODE ###

a = [int(input()) for _ in range(2)]
if a[0] == a[1]:
    print("EQUAL")
else:
    print("GREATER" if a[0] > a[1] else "LESS")
a,b,m=map(int,input().split())
a=[int(i) for i in input().split()]
b=[int(i) for i in input().split()]

ans=99999999999
for i a:
    for j in b:
        ans=min(ans,i+j)
for i in range(m):
    x,y,c=map(int,input().split())
    ans=min(ans,a[x-1]+b[y-1]-c)
print(ans)


### FIXED CODE ###

a,b,m=map(int,input().split())
A=[int(i) for i in input().split()]
B=[int(i) for i in input().split()]

ans=99999999999
ans=min(A)+min(B)
for i in range(m):
    x,y,c=map(int,input().split())
    ans=min(ans,A[x-1]+B[y-1]-c)
print(ans)
input_line = list(str(input('Put any literal: ')))
    for i in range(len(input_line)):
        for j in range(i+1,len(input_line)):
            if input_line[i] == input_line[j]:
                print('Yes')
                return
    print('No')


### FIXED CODE ###

def func():
    input_line = list(str(input('')))
    flag = 0
    for i in range(len(input_line)):
        for j in range(i+1,len(input_line)):
            if input_line[i] == input_line[j]:
                flag += 1
    if flag == 2:
        print('Yes')
    else:
        print('No')


if __name__ == "__main__":
    func()
x=int(input())

for i in range(-118,120):
  for j in range(-118,120):
    if i**2-j**2==x:
      print(i,j)
      exit(1)


### FIXED CODE ###

x=int(input())
# an = n^5 - (n - 1)^5
# a -> 120~-119 -> -118~119
# b -> 119~-120 -> -119~118
for i in range(-118,120):
  for j in range(-119,119):
    if i**5-j**5==x:
      print(i,j)
      exit()
import sys

n = raw_input()
nums = map(int, raw_input().split())
print " ".join(map(str, nums.reverse()))
sys.exit()

### FIXED CODE ###

n = raw_input()
nums = map(int, raw_input().split())
nums.reverse()
print " ".join(map(str, nums))
l,r=map(int,input().split())

if r-l>=2019:
    print(0)
else:
    for i in range(l,r):
        for j in range(i+1,r+1):
            ans=min(ans,(i*j)%2019)

print(ans)


### FIXED CODE ###

from itertools import combinations

l,r = map(int,input().split())

if r - l >= 2019:
    print(0)
else:
    m = 2019
    for i, j in combinations(range(l, r+1),2):
        tmp = i*j % 2019
        if m > tmp:
            m = tmp
    print(m)
N = int(input())
H = list(map(str, input().split()))
S = H[0]
T = H[1]
#print(S)
#print(T)
L=S[0]+T[0]+S[1]+T[1]
#L[1]=T[1]
#L[2]=S[2]
#L[3]=T[2]


if N >=3:
    for i in range(2,N):
        L=L+S[i]
    for i in range(2,N):
        L=L+T[i]
print(L)


### FIXED CODE ###

N = int(input())
H = list(map(str, input().split()))
S = H[0]
T = H[1]
#print(S)
#print(T)
L=S[0]+T[0]
for i in range(1,N):
    L=L+S[i]
    L=L+T[i]
print(L)
n,k = input().split()
k = int(k)
ans = len(int(n,k))
print(ans)

### FIXED CODE ###

n,k = input().split()
k  = int(k)

def Base_10_to_n(X, n):
    if (int(X/n)):
        return Base_10_to_n(int(X/n), n)+str(X%n)
    return str(X%n)
ans = len(str(Base_10_to_n(int(n),k)))
print(ans)
T = list(input())

if T[0] == '?':
    if T[1] == 'D':
        T[0] = 'P'
    else:
        T[0] = 'D'

for i in range(1, len(T) - 1):
    if T[i] == '?':
        if T[i - 1] == 'P':
            T[i] = 'D'
        else:
            if T[i + 1] == 'D':
                T[i] = 'P'
            else:
                T[i] = 'D'

if T[-1] == '?':
    T[-1] = 'D'

print(''.join(T))



### FIXED CODE ###

T = list(input())

if len(T) == 1:
    if T[0] == '?':
        T[0] = 'D'
else:

    if T[0] == '?':
        if T[1] == 'D':
            T[0] = 'P'
        else:
            T[0] = 'D'

    for i in range(1, len(T) - 1):
        if T[i] == '?':
            if T[i - 1] == 'P':
                T[i] = 'D'
            else:
                if T[i + 1] == 'D':
                    T[i] = 'P'
                else:
                    T[i] = 'D'

    if T[-1] == '?':
        T[-1] = 'D'

print(''.join(T))
import math
chou = int(input())
tan = int(input())
ji = int(input())
hun = int(input())
ans = float(0)
kakudo = abs(((ji*30 + hun*.6) - (hun*6)))

if kakudo > 180:
    kakudo = kakudo-360
kakudo = abs(kakudo)
print(kakudo)
kakudo = math.cos(math.degrees(kakudo))
print(kakudo)
ans =( chou**2 + tan**2 - 2*chou*tan*kakudo)
print((ans)**0.5)

### FIXED CODE ###

import math
chou, tan, ji, hun = map(int,input().split())

kakudo = abs(((ji*30 + hun*.5) - (hun*6)))

if kakudo > 180:
    kakudo = 360 - kakudo

kakudo = abs((math.radians(kakudo)))
ans =( chou**2 + tan**2 - 2*chou*tan*math.cos(kakudo))**.5
print(ans)
for e in iter(input,'0 0'):
 N,M=map(int,e.split())
 S=[int(input())for _ in[0]*N]
 p=b=1
 for i in range(M):
  d=int(input())
  p+=d
  p+=S[~-p]
  if(N<=p)*b:print(-~i);b=0


### FIXED CODE ###

import sys
r=sys.stdin.readline
for e in iter(r,'0 0\n'):
 N,M=map(int,e.split())
 k,p=1,0
 S=[int(r())for _ in[0]*N]
 for d in[int(r())for _ in[0]*M]:
  p+=d;
  if p<N:p+=S[p]
  if N<=p+1:break
  k+=1
 print(k)
A=list(map(int, input().split()))
A.sort()
A.reverse()
K=sum(A)
answer=0
breakflag=0
for i in range(0,N):
  if  A[i]*M*4>=K:
    if i==N-1:
      breakflag=1
    continue
  else:
    answer=i
    break
if breakflag==1:
  answer=N
if answer>=M:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

N,M=map(int, input().split())
A=list(map(int, input().split()))
A.sort()
A.reverse()
K=sum(A)
answer=0
breakflag=0
for i in range(0,N):
  if  A[i]*M*4>=K:
    if i==N-1:
      breakflag=1
    continue
  else:
    answer=i
    break
if breakflag==1:
  answer=N
if answer>=M:
    print("Yes")
else:
    print("No")
l=list(input())
k=int(input())
n=len(s)
if n==1:
    if k%2==0:
        print(k//2)
    else:
        print((k-1)//2)
    exit()
al=[]
su=[]
f=1
for i in range(n-1):
    if l[i]!=l[i+1]:
        al.append(l[i])
        su.append(f)
        f=1
    else:
        f+=1
if l[-2]==l[-1]:
    al.append(l[-1])
    su.append(f)
else:
    al.append(l[-1])
    su.append(1)
    
if len(al)==1:
    j=su[0]*k
    if j%2==0:
        print(j//2)
    else:
        print((j-1)//2)
    exit()

if al[0]!=al[-1]:
    ans=0
    for i in su:
        if i%2==0:
            ans+=i//2
        else:
            ans+=(i-1)//2
    print(k*ans)
else:
    ans=0
    if su[0]%2==0:
        ans+=su[0]//2
    else:
        ans+=(su[0]-1)//2
    tmp=0
    for i in range(len(al)-2):
        if su[i+1]%2==0:
            tmp+=su[i+1]//2
        else:
            tmp+=(su[i+1]-1)//2
    ans+=tmp*k
    j=su[0]+su[-1]
    if j%2==0:
        ans+=(j//2)*(k-1)
    else:
        ans+=((j-1)//2)*(k-1)
    if su[-1]%2==0:
        ans+=su[-1]//2
    else:
        ans+=(su[-1]-1)//2
    print(ans)   

### FIXED CODE ###

l=list(input())
k=int(input())
n=len(l)
if n==1:
    if k%2==0:
        print(k//2)
    else:
        print((k-1)//2)
    exit()
al=[]
su=[]
f=1
for i in range(n-1):
    if l[i]!=l[i+1]:
        al.append(l[i])
        su.append(f)
        f=1
    else:
        f+=1
if l[-2]==l[-1]:
    al.append(l[-1])
    su.append(f)
else:
    al.append(l[-1])
    su.append(1)
    
if len(al)==1:
    j=su[0]*k
    if j%2==0:
        print(j//2)
    else:
        print((j-1)//2)
    exit()

if al[0]!=al[-1]:
    ans=0
    for i in su:
        if i%2==0:
            ans+=i//2
        else:
            ans+=(i-1)//2
    print(k*ans)
else:
    ans=0
    if su[0]%2==0:
        ans+=su[0]//2
    else:
        ans+=(su[0]-1)//2
    tmp=0
    for i in range(len(al)-2):
        if su[i+1]%2==0:
            tmp+=su[i+1]//2
        else:
            tmp+=(su[i+1]-1)//2
    ans+=tmp*k
    j=su[0]+su[-1]
    if j%2==0:
        ans+=(j//2)*(k-1)
    else:
        ans+=((j-1)//2)*(k-1)
    if su[-1]%2==0:
        ans+=su[-1]//2
    else:
        ans+=(su[-1]-1)//2
    print(ans)