S=list(input())
n=len(S)
for i in range(n):
  S[i]=int(S[i])
k=int(input())
dp0=[[0]*(n+1) for i in range(k+1)]
dp0[0][0]=1
s=0
for i in range(n):
  if S[i]!=0:
    s=s+1
    if s==k+1:
      break
    dp0[s][i+1]=1
  else:
    dp0[s][i+1]=1
dp1=[[0]*(n+1) for i in range(k+1)]
for i in range(1,n+1):
  if dp0[0][i]==0:
    dp1[0][i]=1
for i in range(1,k+1):
  for j in range(1,n+1):
    if S[j-1]==0:
      dp1[i][j]=dp0[i-1][j-1]*0+dp0[i][j-1]*0+dp1[i-1][j-1]*9+dp1[i][j-1]
    else:
      dp1[i][j]=dp0[i-1][j-1]*(S[j-1]-1)+dp0[i][j-1]+dp1[i-1][j-1]*9+dp1[i][j-1]
print(dp0[-1][-1]+dp1[-1][-1]) S=list(input()) S list(input()) list input() input n=len(S) n len(S) len S for i in range(n):
  S[i]=int(S[i]) i range(n) range n S[i]=int(S[i]) S[i] S i int(S[i]) int S[i] S i k=int(input()) k int(input()) int input() input [0]*(n+1) for i in range(k+1) for i in range(k+1) i range(k+1) range k+1 k 1 for i in range(k+1) [0]*(n+1) [0] 0 n+1 n 1 dp0=[[0]*(n+1) for i in range(k+1)] dp0 [[0]*(n+1) for i in range(k+1)] dp0[0][0]=1 dp0[0][0] [0] dp0 0 0 1 s=0 s 0 for i in range(n):
  if S[i]!=0:
    s=s+1
    if s==k+1:
      break
    dp0[s][i+1]=1
  else:
    dp0[s][i+1]=1 i range(n) range n if S[i]!=0:
    s=s+1
    if s==k+1:
      break
    dp0[s][i+1]=1
  else:
    dp0[s][i+1]=1 S[i]!=0 S[i] S i 0 s=s+1 s s+1 s 1 if s==k+1:
      break
     s==k+1 s k+1 k 1 break dp0[s][i+1]=1 dp0[s][i+1] [s] dp0 s i+1 i 1 1 dp0[s][i+1]=1 dp0[s][i+1] [s] dp0 s i+1 i 1 1 [0]*(n+1) for i in range(k+1) for i in range(k+1) i range(k+1) range k+1 k 1 for i in range(k+1) [0]*(n+1) [0] 0 n+1 n 1 dp1=[[0]*(n+1) for i in range(k+1)] dp1 [[0]*(n+1) for i in range(k+1)] for i in range(1,n+1):
  if dp0[0][i]==0:
    dp1[0][i]=1 i range(1,n+1) range 1 n+1 n 1 if dp0[0][i]==0:
    dp1[0][i]=1 dp0[0][i]==0 dp0[0][i] [0] dp0 0 i 0 dp1[0][i]=1 dp1[0][i] [0] dp1 0 i 1 for i in range(1,k+1):
  for j in range(1,n+1):
    if S[j-1]==0:
      dp1[i][j]=dp0[i-1][j-1]*0+dp0[i][j-1]*0+dp1[i-1][j-1]*9+dp1[i][j-1]
    else:
      dp1[i][j]=dp0[i-1][j-1]*(S[j-1]-1)+dp0[i][j-1]+dp1[i-1][j-1]*9+dp1[i][j-1] i range(1,k+1) range 1 k+1 k 1 for j in range(1,n+1):
    if S[j-1]==0:
      dp1[i][j]=dp0[i-1][j-1]*0+dp0[i][j-1]*0+dp1[i-1][j-1]*9+dp1[i][j-1]
    else:
      dp1[i][j]=dp0[i-1][j-1]*(S[j-1]-1)+dp0[i][j-1]+dp1[i-1][j-1]*9+dp1[i][j-1] j range(1,n+1) range 1 n+1 n 1 if S[j-1]==0:
      dp1[i][j]=dp0[i-1][j-1]*0+dp0[i][j-1]*0+dp1[i-1][j-1]*9+dp1[i][j-1]
    else:
      dp1[i][j]=dp0[i-1][j-1]*(S[j-1]-1)+dp0[i][j-1]+dp1[i-1][j-1]*9+dp1[i][j-1] S[j-1]==0 S[j-1] S j-1 j 1 0 dp1[i][j]=dp0[i-1][j-1]*0+dp0[i][j-1]*0+dp1[i-1][j-1]*9+dp1[i][j-1] dp1[i][j] [i] dp1 i j dp0[i-1][j-1]*0+dp0[i][j-1]*0+dp1[i-1][j-1]*9+dp1[i][j-1] dp0[i-1][j-1]*0+dp0[i][j-1]*0+dp1[i-1][j-1]*9 dp0[i-1][j-1]*0+dp0[i][j-1]*0 dp0[i-1][j-1]*0 dp0[i-1][j-1] [i-1] dp0 i-1 i 1 j-1 j 1 0 dp0[i][j-1]*0 dp0[i][j-1] [i] dp0 i j-1 j 1 0 dp1[i-1][j-1]*9 dp1[i-1][j-1] [i-1] dp1 i-1 i 1 j-1 j 1 9 dp1[i][j-1] [i] dp1 i j-1 j 1 dp1[i][j]=dp0[i-1][j-1]*(S[j-1]-1)+dp0[i][j-1]+dp1[i-1][j-1]*9+dp1[i][j-1] dp1[i][j] [i] dp1 i j dp0[i-1][j-1]*(S[j-1]-1)+dp0[i][j-1]+dp1[i-1][j-1]*9+dp1[i][j-1] dp0[i-1][j-1]*(S[j-1]-1)+dp0[i][j-1]+dp1[i-1][j-1]*9 dp0[i-1][j-1]*(S[j-1]-1)+dp0[i][j-1] dp0[i-1][j-1]*(S[j-1]-1) dp0[i-1][j-1] [i-1] dp0 i-1 i 1 j-1 j 1 S[j-1]-1 S[j-1] S j-1 j 1 1 dp0[i][j-1] [i] dp0 i j-1 j 1 dp1[i-1][j-1]*9 dp1[i-1][j-1] [i-1] dp1 i-1 i 1 j-1 j 1 9 dp1[i][j-1] [i] dp1 i j-1 j 1 print(dp0[-1][-1]+dp1[-1][-1]) print dp0[-1][-1]+dp1[-1][-1] dp0[-1][-1] [-1] dp0 -1 -1 dp1[-1][-1] [-1] dp1 -1 -1 s=s+1 s+1 s k=int(input()) int(input()) k dp0=[[0]*(n+1) for i in range(k+1)] [[0]*(n+1) for i in range(k+1)] dp0 s=0 0 s S=list(input()) list(input()) S dp1=[[0]*(n+1) for i in range(k+1)] [[0]*(n+1) for i in range(k+1)] dp1 n=len(S) len(S) n
S=list(input())
n=len(S)
for i in range(n):
  S[i]=int(S[i])
k=int(input())
dp0=[[0]*(n+1) for i in range(k+1)]
dp0[0][0]=1
s=0
for i in range(n):
  if S[i]!=0:
    s=s+1
    if s==k+1:
      break
    dp0[s][i+1]=1
  else:
    dp0[s][i+1]=1
dp1=[[0]*(n+1) for i in range(k+1)]
for i in range(1,n+1):
  if dp0[0][i]==0:
    dp1[0][i]=1
for i in range(1,k+1):
  for j in range(1,n+1):
    if S[j-1]==0:
      dp1[i][j]=dp0[i-1][j-1]*0+dp0[i][j-1]*0+dp1[i-1][j-1]*9+dp1[i][j-1]
    else:
      dp1[i][j]=dp0[i-1][j-1]*(S[j-1]-1)+dp0[i][j-1]+dp1[i-1][j-1]*9+dp1[i][j-1]
print(dp0[-1][-1]+dp1[-1][-1])