S = input()
N = len(S)
K = int(input())

dp = [[[0 for _ in range(5)] for _ in range(2)] for _ in range(N+5)]
dp[1][0][1] = 1
dp[1][1][0] = 1
dp[1][1][1] = int(S[0])-1

for i in range(1, N):
    n = int(S[i])
    ok = 0 if n == 0 else 1
    for j in range(4):
        dp[i+1][0][j+ok] += dp[i][0][j]
        if n > 0:
            dp[i+1][1][j] += dp[i][0][j]
            dp[i+1][1][j+1] += (n-1)*dp[i][0][j]
        dp[i+1][1][j] += dp[i][1][j]
        dp[i+1][1][j+1] += 9*dp[i][1][j]

print(dp[N][0][K]+dp[N][1][K]) S = input() S input() input N = len(S) N len(S) len S K = int(input()) K int(input()) int input() input [[0 for _ in range(5)] for _ in range(2)] for _ in range(N+5) for _ in range(N+5) _ range(N+5) range N+5 N 5 for _ in range(N+5) [[0 for _ in range(5)] for _ in range(2)] dp = [[[0 for _ in range(5)] for _ in range(2)] for _ in range(N+5)] dp [[[0 for _ in range(5)] for _ in range(2)] for _ in range(N+5)] dp[1][0][1] = 1 dp[1][0][1] [0] [1] dp 1 0 1 1 dp[1][1][0] = 1 dp[1][1][0] [1] [1] dp 1 1 0 1 dp[1][1][1] = int(S[0])-1 dp[1][1][1] [1] [1] dp 1 1 1 int(S[0])-1 int(S[0]) int S[0] S 0 1 for i in range(1, N):
    n = int(S[i])
    ok = 0 if n == 0 else 1
    for j in range(4):
        dp[i+1][0][j+ok] += dp[i][0][j]
        if n > 0:
            dp[i+1][1][j] += dp[i][0][j]
            dp[i+1][1][j+1] += (n-1)*dp[i][0][j]
        dp[i+1][1][j] += dp[i][1][j]
        dp[i+1][1][j+1] += 9*dp[i][1][j] i range(1, N) range 1 N n = int(S[i]) n int(S[i]) int S[i] S i ok = 0 if n == 0 else 1 ok 0 if n == 0 else 1 n == 0 n 0 0 1 for j in range(4):
        dp[i+1][0][j+ok] += dp[i][0][j]
        if n > 0:
            dp[i+1][1][j] += dp[i][0][j]
            dp[i+1][1][j+1] += (n-1)*dp[i][0][j]
        dp[i+1][1][j] += dp[i][1][j]
        dp[i+1][1][j+1] += 9*dp[i][1][j] j range(4) range 4 dp[i+1][0][j+ok] += dp[i][0][j] dp[i+1][0][j+ok] [0] [i+1] dp i+1 i 1 0 j+ok j ok dp[i][0][j] [0] [i] dp i 0 j if n > 0:
            dp[i+1][1][j] += dp[i][0][j]
            dp[i+1][1][j+1] += (n-1)*dp[i][0][j]
         n > 0 n 0 dp[i+1][1][j] += dp[i][0][j] dp[i+1][1][j] [1] [i+1] dp i+1 i 1 1 j dp[i][0][j] [0] [i] dp i 0 j dp[i+1][1][j+1] += (n-1)*dp[i][0][j] dp[i+1][1][j+1] [1] [i+1] dp i+1 i 1 1 j+1 j 1 (n-1)*dp[i][0][j] n-1 n 1 dp[i][0][j] [0] [i] dp i 0 j dp[i+1][1][j] += dp[i][1][j] dp[i+1][1][j] [1] [i+1] dp i+1 i 1 1 j dp[i][1][j] [1] [i] dp i 1 j dp[i+1][1][j+1] += 9*dp[i][1][j] dp[i+1][1][j+1] [1] [i+1] dp i+1 i 1 1 j+1 j 1 9*dp[i][1][j] 9 dp[i][1][j] [1] [i] dp i 1 j print(dp[N][0][K]+dp[N][1][K]) print dp[N][0][K]+dp[N][1][K] dp[N][0][K] [0] [N] dp N 0 K dp[N][1][K] [1] [N] dp N 1 K dp = [[[0 for _ in range(5)] for _ in range(2)] for _ in range(N+5)] [[[0 for _ in range(5)] for _ in range(2)] for _ in range(N+5)] dp K = int(input()) int(input()) K S = input() input() S ok = 0 if n == 0 else 1 0 if n == 0 else 1 ok N = len(S) len(S) N n = int(S[i]) int(S[i]) n
S = input()
N = len(S)
K = int(input())

dp = [[[0 for _ in range(5)] for _ in range(2)] for _ in range(N+5)]
dp[1][0][1] = 1
dp[1][1][0] = 1
dp[1][1][1] = int(S[0])-1

for i in range(1, N):
    n = int(S[i])
    ok = 0 if n == 0 else 1
    for j in range(4):
        dp[i+1][0][j+ok] += dp[i][0][j]
        if n > 0:
            dp[i+1][1][j] += dp[i][0][j]
            dp[i+1][1][j+1] += (n-1)*dp[i][0][j]
        dp[i+1][1][j] += dp[i][1][j]
        dp[i+1][1][j+1] += 9*dp[i][1][j]

print(dp[N][0][K]+dp[N][1][K])