Harryxun/stf_run huggingface dataset:
n=int(input())
s=input()
k=int(input())
key=s[k-1]
ans=""
for i in range(len(s)):
  if s[i]==key:
    ans+=key
  else:
    ans+="*"
print(ans)


### FIXED CODE ###

a,b,c=map(int,input().split())
if a<c<b or b<c<a:
  print("Yes")
else:
  print("No")
def spaceinput():
    return list(map(int,input().split(" ")))


N=int(input())
a=spaceinput()


sa=sorted(a,reverse=True)
x=[]
i=0
while True:
    ssa=sa[i]
    if sa[i]==sa[i+1]:
        x.append(ssa)
        i+=2
        if len(x)==2:
            break

    i+=1

x.extend([0,0])

print(x[0]*x[1])


### FIXED CODE ###

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


N=int(input())
a=spaceinput()


sa=sorted(a,reverse=True)
x=[]
i=0
while True:
    if i>=len(sa)-1:
        break
    ssa=sa[i]
    if sa[i]==sa[i+1]:
        x.append(ssa)
        i+=2
        if len(x)==2:
            break
        continue

    else:
        i+=1


x.extend([0,0])

print(x[0]*x[1])
while True:
  count = input()
  if count == 0: break
  previous_cube = [ 1, 2, 3, 4, 5, 6]
  operation = {'North':[1, 5, 2, 3, 0, 4], 'East':[3, 1, 0, 5, 4, 2], 'West': [2, 1, 5, 0, 4, 3], 'South':[4, 0, 2, 3, 5, 1], 'Right':[0, 2, 4, 1, 3, 5], 'Left':[0, 3, 1, 4, 2, 5]}
  sum = 1
  for i in xrange(count):
    new_cube = []
    for e in xrange(5):
      new_cube.append(previous_cube[operation[raw_input().split()][e]])
    sum += new_cube[0]
    previous_cube = new_cube
  print sum

### FIXED CODE ###

while 1:
  n = input()
  if n == 0:  break
  d = range(1, 7)
  ans = 1
  for i in range(n):
    c = raw_input()[0]
    if c == 'N': S = [1,5,2,3,0,4]
    elif c == "S": S = [4,0,2,3,5,1]
    elif c == "E": S = [3,1,0,5,4,2]
    elif c == "W": S = [2,1,5,0,4,3]
    elif c == "R": S = [0,2,4,1,3,5]
    elif c == "L": S = [0,3,1,4,2,5]
    d = [d[s] for s in S]
    ans += d[0]
  print ans
from sys import stdin
X = (stdin.readline().rstrip())
X_l = X[:(len(X)/2)]
X_r = X[(len(X)/2):]
print(len(X) - min(X_l.count("S"),X_r.count("T")) * 2)

### FIXED CODE ###

from sys import stdin
from collections import deque
X = (stdin.readline().rstrip())
stack = []
for i in X:
    if i == "S":
        stack.append(i)
    elif (i == "T" and stack == []):
        stack.append(i)
    elif (i == "T" and stack[-1] == "S"):
        stack.pop()
    else:
        stack.append(i)
print(len(stack))
n,k = map(str, input().split())
s = str(input()) 

k_lower = s.lower(k-1)
print(k_lower)


### FIXED CODE ###

n,k = map(int, input().split())
s = str(input()) 

print(s[:k-1]+s[k-1].lower()+s[k:])
import sys
from collections import Counter
readline = sys.stdin.buffer.readline
MOD = 10**9+7

def main():
    A, B = map(int, readline().split())
    if A>B:
        print('GREATER')
    elif A<B:
        print('LESS')
    else:
        print('EQUAL')




if __name__ == '__main__':
    main()

### FIXED CODE ###

import sys
from collections import Counter
readline = sys.stdin.buffer.readline
MOD = 10**9+7

def main():
    A = int(readline())
    B = int(readline())
    if A>B:
        print('GREATER')
    elif A<B:
        print('LESS')
    else:
        print('EQUAL')




if __name__ == '__main__':
    main()
import math
a,b,c,d = map(int,input().split())
def calc(n,x,y):
    cnt = n // x
    cnt += n//y
    lcm = x*y//math.gcd(x,y)
    cnt -= n//lcm
    return n - cnt

print(calc(b,c,d)-calc(a-1,c,d))


### FIXED CODE ###

import fractions
a,b,c,d = map(int,input().split())
def calc(n,x,y):
    cnt = n // x
    cnt += n//y
    lcm = x*y//fractions.gcd(x,y)
    cnt -= n//lcm
    return n - cnt

print(calc(b,c,d)-calc(a-1,c,d))
class Group:
    
    def __init__(self, x, y):
        self.n = 1
        self.x = [x]
        self.y = [y]
        
    def insert(self, x, y):
        if x not in self.x:
            self.x.append(x)
        if y not in self.y:
            self.y.append(y)
        self.n += 1
    
    def new_cor_n(self):
        if self.n == 0:
            return 0
        return len(self.x) * len(self.y) - self.n

    def join(self, group):
        self.n += group.n
        self.x.extend(group.x)
        self.x = list(set(self.x))
        self.y.extend(group.y)
        self.y = list(set(self.y))
        group.n = 0


if N <= 2:
    print(0)
else:
    xg, yg = {}, {}
    group_list = []
    for xi, yi in COR:
        if xi in xg:
            if yi in yg:
                xg[xi].join(yg[yi])
            group = xg[xi]
            yg[yi] = group
            group.insert(xi, yi)
        elif yi in yg:
            group = yg[yi]
            xg[xi] = group
            group.insert(xi, yi)
        else:
            new_group = Group(xi, yi)
            xg[xi] = new_group
            yg[yi] = new_group
            group_list.append(new_group)
    s = 0
    for group in group_list:
        s += group.new_cor_n()
    print(s)

### FIXED CODE ###

# import sys
# sys.setrecursionlimit(20000)


N = int(input())
COR = [tuple((map(int, input().split()))) for _ in range(N)]


class Group:
    
    def __init__(self):
        self.n = 0
        self.x = 0
        self.y = 0
        self.xy = {}
        
    def new_cor_n(self):
        return self.x * self.y - self.n
        

def grouping(group, x, xcor, ycor):
    x_list = []
    group.x += 1
    for y in xcor[x][0]:
        if (x, y) not in group.xy:
            group.n += 1
            group.xy[(x, y)] = None
        if ycor[y][1]:
            continue
        ycor[y][1] = True
        group.y += 1
        for x_ in ycor[y][0]:
            if (x_, y) not in group.xy:
                group.n += 1
                group.xy[(x_, y)] = None
            if xcor[x_][1]:
                continue
            xcor[x_][1] = True
            x_list.append(x_)
    return x_list

if N <= 2:
    print(0)
else:
    xcor, ycor = {}, {}
    for xi, yi in COR:
        if xi in xcor:
            xcor[xi][0].append(yi)
        else:
            xcor[xi] = [[yi], False]
        if yi in ycor:
            ycor[yi][0].append(xi)
        else:
            ycor[yi] = [[xi], False]
    group_list = []
    for i, v in xcor.items():
        if v[1]:
            continue
        group = Group()
        group_list.append(group)
        xcor[i][1] = True
        x_list = [i]
        while True:
            new_x_list = []
            for x in x_list:
                new_x_list += grouping(group, x, xcor, ycor)
            if new_x_list == []:
                break
            x_list = new_x_list
    s = 0
    for group in group_list:
        s += group.new_cor_n()
    print(s)
import sys
from collections import deque
import copy
def main():
    N = int(input())
    A = [int(i) for i in input().split()]
    A.sort()
    MAX = 2 * (10 ** 5) + 1
    prime = [True] * MAX
    ans = 0
    for i in range(1, N):
        if A[i] == A[i - 1]:
            prime[A[i]] = False
    for i in range(N):
        now = A[i]
        if prime[now]:
            ans += 1
            for j in range(now * 2, MAX, now):
                prime[j] = False
    print(ans)


if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys
from collections import deque
import copy
def main():
    N = int(input())
    A = [int(i) for i in input().split()]
    A.sort()
    MAX = (10 ** 6) + 5
    prime = [True] * MAX
    ans = 0
    for i in range(1, N):
        if A[i] == A[i - 1] and prime[A[i]]:
            prime[A[i]] = False
            for j in range(A[i] * 2, MAX, A[i]):
                prime[j] = False
    for i in range(N):
        now = A[i]
        if prime[now]:
            ans += 1
            for j in range(now * 2, MAX, now):
                prime[j] = False
    print(ans)


if __name__ == '__main__':
    main()
s=int(input("羊:"))
w=int(input("狼:"))
if s>w:
    print("safe")
else:
    print("unsafe")

### FIXED CODE ###

s,w = map(int, input().split())
 
if s > w:
    print('safe')
else:
    print('unsafe')
def main():
    N, M = map(int, input().split())
    A = [int(input()) for i in range(M)] + [0]

    a = 0
    b = 1
    j = 0
    tmp = 0
    if N == 1:
        print(1)
    else:
        for i in range(1, N + 1):
            if A[j] == i:
                if tmp == 1:
                    print(0)
                    exit()
                tmp = 1
                j += 1
                a = 0
            else:
                if tmp == 1:
                    b = a + b
                    a = 0
                else:
                    c = a + b
                    a = b
                    b = c
                tmp = 0
        print(c % 1000000007)

if __name__ == '__main__':
    main()


### FIXED CODE ###

import math
def cmb(n, r, mod, g1, g2):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod

def main():
    N, M = map(int, input().split())
    A = [-1] + [int(input()) for i in range(M)] + [N + 1]

    mod = 10**9+7 #出力の制限
    N = 10**5
    g1 = [1, 1] # 元テーブル
    g2 = [1, 1] #逆元テーブル
    inverse = [0, 1] #逆元テーブル計算用テーブル
    for i in range( 2, N + 1 ):
        g1.append( ( g1[-1] * i ) % mod )
        inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
        g2.append( (g2[-1] * inverse[-1]) % mod )

    d = [0] * (len(A) - 1)
    for i in range(len(A) - 1):
        if A[i+1] - A[i] == 1:
            print(0)
            exit(0)
        d[i] = A[i+1] - 1 - (A[i] + 1)

    ans = 1
    for dd in d:
        if dd > 1:
            tmp = 0
            for j in range(dd//2 + 1):
                tmp += cmb(dd - j, j, mod, g1, g2)
            ans *= tmp

    print(ans % 1000000007)

if __name__ == '__main__':
    main()
from bisect import bisect_left
import sys

N, M = map(int, input().split())
A = list(map(int, input().split()))

if N == 1:
    for i in range(M):
        A[0] = A[0] // 2
    print(sum(A))
    sys.exit()

A.sort(reverse=True)

index = 0
for i in range(M):
    A[index] = A[index] // 2
    aMax = A[index]
    for j in range(N):
        if aMax < A[i]:
            aMax = A[i]
            index = i
            break

print(sum(A))

### FIXED CODE ###

import heapq
import sys

N, M = map(int, input().split())
A = list(map(int, input().split()))

if N == 1:
    for i in range(M):
        A[0] = A[0] // 2
    print(sum(A))
    sys.exit()
h = []
for i in range(N):
    heapq.heappush(h, -A[i])

for i in range(M):
    tmp = heapq.heappop(h)
    tmp = -(-tmp // 2)
    heapq.heappush(h, tmp)


print(-sum(h))
S = input()
if S = "Sunny":
    print("Cloudy")
if S = "Cloudy":
    pirnt("Rainy")
if S = "Rainy":
    print("Sunny")

### FIXED CODE ###

S = input()
if S == "Sunny":
    print("Cloudy")
if S == "Cloudy":
    print("Rainy")
if S == "Rainy":
    print("Sunny")
A, B, K = map(int, input().split())

list2 = [ A + K - 1 , B - K + 1]
if min(list2) == max(list2):
    list3 = ["-1"]
else:
    list3 = list(range(min(list2)+1,max(list2)))
i = A
while i <= B:
    if i not in list3:
        print(i)
    elif A > B - K:
        print(i)
    i += 1


### FIXED CODE ###

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

list2 = [ A + K - 1 , B - K + 1]
if A + K - 1 >= B - K +1 or A > B - K:
    i = A
    while i <= B:
        print(i)
        i += 1
else:
    i = A
    while i <= A + K - 1:
        print(i)
        i += 1
    i = B - K + 1
    while i <= B:
        print(i)
        i += 1
def main():
    a, b = map(int, inptut().split())
    print((a - 1) * (b - 1))

if __name__ == '__main__':
    main()


### FIXED CODE ###

a, b = list(map(int, input().split()))
print((a - 1) * (b - 1))
N=int(input())
P = list(map(int,input().split()))
ans=0
 
 
for i in range(N):
    if min(P[:i+1])==P[i]:
      ans+=1
print(ans)

### FIXED CODE ###

N,M = map(int,input().split())

if N==M:
    print('Yes')
else:
    print('No')
a, b, n = map(int, input().split())
if n < b:
    ans = a*n//b
else:
    ans = max(ans, (a*(b*2-1))//b - a)
    li = [1, (1+(n//b))//2, -(-(1+(n//b))//2)]
    for i in li:
        check = (a*(b*(i+1)-1))//b - a*i
        ans = max(ans, check)
    ans = max(ans, (a*n)//b)-a*(n//b)
print(ans)

### FIXED CODE ###

a, b, n = map(int, input().split())
ans = 0
if n < b:
    ans = max(ans, a*n//b)
else:
    ans = max(ans, (a*n)//b)-a*(n//b)
    ans = max(ans, ((a*(b*(n//b)-1))//b)-a*(n//b - 1))
print(ans)
for i in range(1,10):
    for j in range(1,10):
        print str(i) + 'x' + str(j) + '=' + str(i*j)

### FIXED CODE ###

for i in range(1,10):
    for j in range(1,10):
        print str(i) + 'x' + str(j) + '=' + str(i*j)
def resolve():
    N = int(input())
    list = list(map(int, input().split()))
    lists = np.array(list)
    print(np.prod(lists) if np.prod(lists)<=10**18 else "-1")
resolve()

### FIXED CODE ###

def resolve():
    N = int(input())
    A = list(map(int, input().split()))
    ans = 1
    if 0 in A:
        print(0)
        exit()
    for i in A:
        ans *= i
        if ans > 10**18:
            print(-1)
            exit()
    print(ans)
resolve()
from typing import List

def problem():
    N = int(input())
    V = list(map(int, input().split()))
    C = list(map(int, input().split()))
 
    print(algorithm(N, V, C))
 
 
def algorithm(N: int, V: List[int], C: List[int]):
    indices = list(filter(lambda i: V[i] - C[i] > 0, list(range(0, N))))
 
    sum = 0
    for i in indices:
        sum += V[i] - C[i]
    return sum
 
problem()

### FIXED CODE ###


def problem():
    N = int(input())
    V = list(map(int, input().split()))
    C = list(map(int, input().split()))

    print(algorithm(N, V, C))


def algorithm(N, V, C):
    indices = list(filter(lambda i: V[i] - C[i] > 0, list(range(0, N))))

    sum = 0
    for i in indices:
        sum += V[i] - C[i]
    return sum

problem()
N = int(input())
print([0, 1][if N > 105]

### FIXED CODE ###

n = int(input())
ans = 0
for i in range(1,n+1,2):
    co = 0
    for f in range(1,i+1):
        if i % f == 0:
            co += 1
    if co == 8:
        ans += 1
print(ans)
from sys import stdin
from collections import deque
from math import sqrt, floor, ceil, log, log2, log10, pi, gcd, sin, cos, asin


def ii(): return int(stdin.readline())


def fi(): return float(stdin.readline())


def mi(): return map(int, stdin.readline().split())


def fmi(): return map(float, stdin.readline().split())


def li(): return list(mi())


def lsi():
    x=list(stdin.readline())
    x.pop()
    return x


def si(): return stdin.readline()


def sieve(x):
    a=[True]*(x+1)
    sq=floor(sqrt(x))
    for i in range(3, sq+1, 2):
        if a[i]:
            for j in range(i*i, x+1, i):
                a[j]=False
    if x>1:
        p=[2]
    else:
        p=[]
    for i in range(3, x+1, 2):
        if a[i]:
            p.append(i)
    return p
#vowel={'a', 'e', 'i', 'o', 'u', 'y', 'A', 'E', 'I', 'O', 'U', 'Y'}
#pow=[1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072, 262144, 524288, 1048576, 2097152, 4194304, 8388608, 16777216, 33554432, 67108864, 134217728, 268435456, 536870912, 1073741824, 2147483648, 4294967296, 8589934592, 17179869184, 34359738368, 68719476736, 137438953472, 274877906944, 549755813888, 1099511627776, 2199023255552, 4398046511104, 8796093022208, 17592186044416, 35184372088832, 70368744177664, 140737488355328, 281474976710656, 562949953421312, 1125899906842624, 2251799813685248, 4503599627370496, 9007199254740992, 18014398509481984, 36028797018963968, 72057594037927936, 144115188075855872, 288230376151711744, 576460752303423488, 1152921504606846976, 2305843009213693952, 4611686018427387904, 9223372036854775808]
############# CODE STARTS HERE #############
a=lsi()
s, e=0, len(a)-1
c=0
while s<e:
    if a[s]!=a[e]:
        c+=1
    s+=1
    e-=1
print(c)

### FIXED CODE ###

s = input()
res = 0
for i in range(len(s)//2):
    res += int(s[i] != s[len(s)-i-1])
print(res)
N, M = map(int, input().split())

B = [list(map(int, input().split())) for _ in range(M)][::-1]

pt = []
G = [None] * (N+1)
C = [0] * (N+1)
idx = 0
cnt = 0
for x, y in B:
    wx = G[x]
    wy = G[y]
    wcnt = (wx is None) + (wy is None)

    if wcnt >= 2:
        pt.append(1)
        w = [idx]
        C[idx] += 2
        idx += 1
        G[x] = w
        G[y] = w
    elif wcnt == 1:
        if wx is None:
            wx = wy
            G[x] = G[y]
        else:
            G[y] = G[x]
        pt.append(C[wx[0]])
        C[wx[0]] += 1
    else:
        if wx[0] == wy[0]:
            pt.append(0)
        else:
            pt.append(C[wx[0]] * C[wy[0]])
            C[wx[0]] += C[wy[0]]
            G[y][0] = G[x][0]

    #print((G, C))

cnt = 0
for x in pt[::-1]:
    cnt += x
    print(cnt)


### FIXED CODE ###

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

pt = []
G = [[None, 1] for x in range(N+1)]

def find(x):
    n = G[x]
    c = []
    while not n[0] is None:
        c.append(n)
        n = n[0]
    for ci in c:
        ci[0] = n
    return n

cnt = 0
while len(B):
    x, y = B.pop()
    wx = find(x)
    wy = find(y)
    if wx is wy:
        pt.append(0)
    else:
        pt.append(wx[1] * wy[1])
        wx[1] += wy[1]
        wy[0] = wx

    #print(G)

cnt = 0
for _ in range(M):
    cnt += pt.pop()
    print(cnt)
#!/usr/bin/env python
# -*- coding: utf-8 -*-

while True:
    N,K = map(int,raw_input().split())
    A = sorted([int(rraw_input()) for i in range(0,K)])

    if (N,K) == (0,0):
        break

    if A[0] == 0:
        flag = True
        A = A[1:]
        K -= 1
    else:
        flag = False

    diff = []
    ans = 0
    prev = 0
    prev_prev = 0
    count = 0
    for i in range(1,K):
        if A[i] - A[i-1] == 1:
            count += 1
            ans = max(ans,count-prev_prev)
        elif A[i] - A[i-1] == 2:
            if flag is True:
                count += 1
                ans = max(ans,count-prev_prev)
                prev_prev = prev
                prev = count - prev
            else:
                count = 0
        else:
            count = 0
    print(ans + A[0])

### FIXED CODE ###

#!/usr/bin/env python
# -*- coding: utf-8 -*-

while True:
    N,K = map(int,raw_input().split())
    A = sorted([int(raw_input()) for i in range(0,K)])

    if (N,K) == (0,0):
        break

    if A[0] == 0:
        flag = True
        A = A[1:]
        K -= 1
    else:
        flag = False

    ans = 0
    count = 0
    diff_list = []
    s = 0
    for i in range(1,K):
        if A[i] - A[i-1] == 2:
            diff_list.append(A[i-1] - A[s])
            s = i
            count = 0
        elif A[i] - A[i-1] > 2:
            diff_list.append(A[i-1] - A[s])
            diff_list.append(0)
            s = i
            count = 0
        else:
            count += 1
            ans = max(ans,count)
    else:
        diff_list.append(A[i] - A[s])

    if flag is True:
        ans = 0
        for i in range(1,len(diff_list)):
            ans = max(ans,diff_list[i] + diff_list[i-1] + 2)

    print(ans + 1)
P=int(input())
Q=int(input())
R=int(input())

if P+Q<=Q+R:
    if P+Q<=R+P:
        print(P+Q)
    else:
        print(R+P)
elif Q+R<P+Q:
    if Q+R<=R+P:
        print(Q+R)
    else:
        print(R+P)

### FIXED CODE ###

p,q,r = map(int, input().split())
print(min(p+q,q+r,r+p))
import math
n = int(input())
b = [1]*(n+1)
mod = 1e9 + 7
a = [int(i) for i in input().split()]
    
for i in range(n):
    for j in range(i+1,n):
        x = a[i];y = a[j];m = math.gcd(x,y);
        x //= m;y //= m;
        b[i] = int(b[i]*y)//int(math.gcd(b[i],y))
        b[j] = int(b[j]*x)//int(math.gcd(b[j],x))
sum = 0
for i in range(n):
    sum += b[i]
print("%d" %(sum%mod))


### FIXED CODE ###

def gcd(a,b):
    if b==0:
        return a
    else:
        return gcd(b,a%b)
n=int(input())
mod=1000000007
s=[int(i) for i in input().split()]
ans=1
for i in s:
    ans*=i//gcd(ans,i)
print(sum(ans//i for i in s)%mod)
import sys

a = eval(raw_input())
b = eval(raw_input())

s1 = a * b
s2 = 2 * (a + b)
print s1, s2

### FIXED CODE ###

import sys

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

print (a * b, (a + b) * 2)
N=input()
print(N**3)

### FIXED CODE ###

N=input()
print(int(N)**3)
a,b=map(int,input().split())
print(a*b9

### FIXED CODE ###

a,b=map(int,input().split())
print(a*b)
N, M = map(int, input().split())
a = [-10]
ans = -1
MOD = 10 ** 9 + 7
for i in range(M):
    a += [int(input())]
    if a[i + 1] - a[i] == 1:
        ans = 0
        break
if ans != 0:
    memo = [0] * (N + 1)
    memo[0] = 1
    if 1 in a:
        memo[1] = 0
    else:
        memo[1] = 1
    for i in range(N - 1):
        if i + 2 in a:
            continue
        memo[i + 2] = memo[i] + memo[i + 1]
        memo[i + 2] = memo[i + 2] % MOD
    else:
        ans = memo[i + 2]
print(ans)

### FIXED CODE ###

N, M = map(int, input().split())
a = []
ans = -1
MOD = 10 ** 9 + 7
if N == 1:
    ans = 1
else:
    if M > 0:
        a += [int(input())]
    for i in range(M - 1):
        a += [int(input())]
        if a[i + 1] - a[i] == 1:
            ans = 0
            break
    a.append([-1])
if not ans in [0, 1]:
    memo = [0] * (N + 1)
    memo[0] = 1
    memo[1] = 1
    try:
        if a[0] == 1:
            a.pop(0)
            memo[1] = 0
    except:
        pass
    j = 0
    for i in range(N - 1):
        if i + 2 == a[j]:
            j += 1
            continue
        memo[i + 2] = memo[i] + memo[i + 1]
        memo[i + 2] = memo[i + 2] % MOD
    else:
        ans = memo[i + 2]
print(ans)
# -*- coding: utf-8 -*-

import sys
input = sys.stdin.readline

def io_generator():
	return input()

#+++++++++++++++++++

def main(io):
	s=io()
	num_st=[0,0]
	for i, c in enumerate(list(s)):
		if int(c) == i % 2:
			num_st[0]+=1
		else:
			num_st[1]+=1
	
	return min(num_st)

#++++++++++++++++++++

if __name__ == "__main__":
	io= lambda : io_generator()
	print (main(io))

### FIXED CODE ###

s=input()
num_st=[0,0]
for i, c in enumerate(list(s)):
	if int(c) == i % 2:
		num_st[0]+=1
	else:
		num_st[1]+=1

ret = min(num_st)
print(int(ret))
class UnionFind:
  def __init__(self, N):
    self.r = [-1]*(N+1)
  
  def root(self, x):
    if self.r[x] < 0:
      return x
    else:
      self.r[x] = self.root(self.r[x])
      return self.r[x]
  
  def unite(self, x, y):
    x = self.root(x)
    y = self.root(y)
    if x == y:
      return False
    else:
      self.r[x] += self.r[y]
      self.r[y] = x
      return True
    
  def size(self, x):
    return -1*self.r[self.root(x)]
  
  def print(self):
    print(self.r)


N, M = map(int, input().split())

UF = UnionFind(N)

for _ in range(M):
  a, b = map(int, input().split())
  UF.unite(a-1, b-1)

ans = 0
for i in range(N):
  ans = max(ans, UF.size(i))

print(ans)

### FIXED CODE ###

class UnionFind:
  def __init__(self, N):
    self.r = [-1]*N
  
  def root(self, x):
    if self.r[x] < 0:
      return x
    else:
      self.r[x] = self.root(self.r[x])
      return self.r[x]
  
  def unite(self, x, y):
    x = self.root(x)
    y = self.root(y)
    if x == y:
      return False
    else:
      if self.r[x] > self.r[y]:
        x, y = y, x
      self.r[x] += self.r[y]
      self.r[y] = x
      return True
    
  def size(self, x):
    return -1*self.r[self.root(x)]
  
  def print(self):
    print(self.r)


N, M = map(int, input().split())

UF = UnionFind(N)

for _ in range(M):
  a, b = map(int, input().split())
  UF.unite(a-1, b-1)

ans = 0
for i in range(N):
  ans = max(ans, UF.size(i))

print(ans)
n = input()
k = int(input())

import math

def func(n,k):
  if k==0:
    return 0
  digit = len(n)
  res = 0
  if digit == 1:
    if k ==1:
      res = int(n)
    return res
  if digit == 2:
    if k ==2:
      res = (int(n) - 9 - int(n) //10)
    elif k == 3:
      res = (0)
    else:
      res = (9+int(n)//10)
    return res

  base = 9**k * (math.factorial(digit-1)/ (math.factorial(k) * math.factorial(digit-1-k)) )

  for i in range(9):
    i+= 1
    if i < int(n[0]):
      base += func(n[1:],k-1)
  return base

print(int(func(n,k)))

### FIXED CODE ###

import math
import sys
n=int(input())
k=int(input())
s=str(n)
l=len(s)
dp0=[[0 for j in range(k+1)] for i in range(l)]
dp1=[[0 for j in range(k+1)] for i in range(l)]

x=int(s[0])
dp0[0][1]=x-1
dp0[0][0]=1
dp1[0][1]=1
for i in range(1,l):
    x=int(s[i])
    dp0[i][0]=1

    for j in range(1,k+1):
        dp0[i][j]+=dp0[i-1][j-1]*9+dp0[i-1][j]
        if x>0:
            dp0[i][j]+=dp1[i-1][j-1]*(x-1)+dp1[i-1][j]
            dp1[i][j]=dp1[i-1][j-1]
        else:
            dp1[i][j]=dp1[i-1][j]

print(dp0[l-1][k]+dp1[l-1][k])