n="0"+input()
k=int(input())
dp=[[[0]*5,[0]*5] for _ in range(len(n))]
dp[0][1][0]=1
for i in range(1,len(n)):
    x=int(n[i])
    for j in range(4):
        if dp[i-1][1][j]:
            dp[i][1][j+(x!=0)]=1
            if x>1:
                dp[i][0][j+1]+=(x-1)
                dp[i][0][j]+=1
            elif x==1:
                dp[i][0][j]+=1
        if dp[i-1][0][j]:
            dp[i][0][j]+=dp[i-1][0][j]
            dp[i][0][j+1]+=(dp[i-1][0][j]*9)
    dp[i][0][0]=1

print(dp[-1][0][k]+dp[-1][1][k]) n="0"+input() n "0"+input() "0" input() input k=int(input()) k int(input()) int input() input [[0]*5,[0]*5] for _ in range(len(n)) for _ in range(len(n)) _ range(len(n)) range len(n) len n for _ in range(len(n)) [[0]*5,[0]*5] [0]*5 [0] 0 5 [0]*5 [0] 0 5 dp=[[[0]*5,[0]*5] for _ in range(len(n))] dp [[[0]*5,[0]*5] for _ in range(len(n))] dp[0][1][0]=1 dp[0][1][0] [1] [0] dp 0 1 0 1 for i in range(1,len(n)):
    x=int(n[i])
    for j in range(4):
        if dp[i-1][1][j]:
            dp[i][1][j+(x!=0)]=1
            if x>1:
                dp[i][0][j+1]+=(x-1)
                dp[i][0][j]+=1
            elif x==1:
                dp[i][0][j]+=1
        if dp[i-1][0][j]:
            dp[i][0][j]+=dp[i-1][0][j]
            dp[i][0][j+1]+=(dp[i-1][0][j]*9)
    dp[i][0][0]=1 i range(1,len(n)) range 1 len(n) len n x=int(n[i]) x int(n[i]) int n[i] n i for j in range(4):
        if dp[i-1][1][j]:
            dp[i][1][j+(x!=0)]=1
            if x>1:
                dp[i][0][j+1]+=(x-1)
                dp[i][0][j]+=1
            elif x==1:
                dp[i][0][j]+=1
        if dp[i-1][0][j]:
            dp[i][0][j]+=dp[i-1][0][j]
            dp[i][0][j+1]+=(dp[i-1][0][j]*9)
     j range(4) range 4 if dp[i-1][1][j]:
            dp[i][1][j+(x!=0)]=1
            if x>1:
                dp[i][0][j+1]+=(x-1)
                dp[i][0][j]+=1
            elif x==1:
                dp[i][0][j]+=1
         dp[i-1][1][j] [1] [i-1] dp i-1 i 1 1 j dp[i][1][j+(x!=0)]=1 dp[i][1][j+(x!=0)] [1] [i] dp i 1 j+(x!=0) j x!=0 x 0 1 if x>1:
                dp[i][0][j+1]+=(x-1)
                dp[i][0][j]+=1
            elif x==1:
                dp[i][0][j]+=1
         x>1 x 1 dp[i][0][j+1]+=(x-1) dp[i][0][j+1] [0] [i] dp i 0 j+1 j 1 x-1 x 1 dp[i][0][j]+=1 dp[i][0][j] [0] [i] dp i 0 j 1 elif x==1:
                dp[i][0][j]+=1
         x==1 x 1 dp[i][0][j]+=1 dp[i][0][j] [0] [i] dp i 0 j 1 if dp[i-1][0][j]:
            dp[i][0][j]+=dp[i-1][0][j]
            dp[i][0][j+1]+=(dp[i-1][0][j]*9)
     dp[i-1][0][j] [0] [i-1] dp i-1 i 1 0 j dp[i][0][j]+=dp[i-1][0][j] dp[i][0][j] [0] [i] dp i 0 j dp[i-1][0][j] [0] [i-1] dp i-1 i 1 0 j dp[i][0][j+1]+=(dp[i-1][0][j]*9) dp[i][0][j+1] [0] [i] dp i 0 j+1 j 1 dp[i-1][0][j]*9 dp[i-1][0][j] [0] [i-1] dp i-1 i 1 0 j 9 dp[i][0][0]=1 dp[i][0][0] [0] [i] dp i 0 0 1 print(dp[-1][0][k]+dp[-1][1][k]) print dp[-1][0][k]+dp[-1][1][k] dp[-1][0][k] [0] [-1] dp -1 0 k dp[-1][1][k] [1] [-1] dp -1 1 k dp=[[[0]*5,[0]*5] for _ in range(len(n))] [[[0]*5,[0]*5] for _ in range(len(n))] dp x=int(n[i]) int(n[i]) x n="0"+input() "0"+input() n k=int(input()) int(input()) k
n="0"+input()
k=int(input())
dp=[[[0]*5,[0]*5] for _ in range(len(n))]
dp[0][1][0]=1
for i in range(1,len(n)):
    x=int(n[i])
    for j in range(4):
        if dp[i-1][1][j]:
            dp[i][1][j+(x!=0)]=1
            if x>1:
                dp[i][0][j+1]+=(x-1)
                dp[i][0][j]+=1
            elif x==1:
                dp[i][0][j]+=1
        if dp[i-1][0][j]:
            dp[i][0][j]+=dp[i-1][0][j]
            dp[i][0][j+1]+=(dp[i-1][0][j]*9)
    dp[i][0][0]=1

print(dp[-1][0][k]+dp[-1][1][k])