output_description: Print the count.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N
      K
attempt: N = input()
  K = int(input())
  m = len(N)
  a = 0
  if K == 3:
      for i in range(1, m - 2):
          a += i * (i + 1)
      a //= 2
      a *= 729
      for i in range(1, 10):
          for j in range(1, 10):
              for k in range(1, 10):
                  for b in range(m - 2):
                      for c in range(m - 2 - b):
                          if N >= str(i) + "0" * b + str(j) + "0" * c + str(k) + "0" * (
                              m - 3 - b - c
                          ):
                              a += 1
  elif K == 1:
      if int(N) < 10:
          a = int(N)
      else:
          a = 9
          for i in range(2, m):
              a += 9
          for i in range(1, 10):
              if N >= str(i) + "0" * (m - 1):
                  a += 1
  else:
      for i in range(1, m - 1):
          a += i
      a *= 81
      for i in range(1, 10):
          for j in range(1, 10):
              for k in range(m - 1):
                  if N >= str(i) + "0" * k + str(j) + "0" * (m - 2 - k):
                      a += 1
  print(a)
  
problem_description: Statement
  
  Find the number of integers between 1 and N (inclusive) that contains exactly
  K non-zero digits when written in base ten.
samples: [{"input": "100\n    1", "output": "19\n    \n\nThe following 19 integers satisfy the condition:\n\n  * 1,2,3,4,5,6,7,8,9,10,20,30,40,50,60,70,80,90,100\n\n* * *"}, {"input": "25\n    2", "output": "14\n    \n\nThe following 14 integers satisfy the condition:\n\n  * 11,12,13,14,15,16,17,18,19,21,22,23,24,25\n\n* * *"}, {"input": "314159\n    2", "output": "937\n    \n\n* * *"}, {"input": "9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999\n    3", "output": "117879300"}]