output_description: Print the smallest possible sum of the digits in the decimal notation of a
  positive multiple of K.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      K
attempt: p = int(input())
  if p % 5 == 0 and p % 2 == 0:
      print(1)
  else:
      m = 1000000000000000
      for i in range(1, 100001):
          v = p * i
          s = 0
          for j in range(10000):
              s += v % 10
              v //= 10
              if v == 0:
                  break
          if v >= 100000:
              s += 1
          m = min(m, s)
      print(m)
  
problem_description: Statement
  
  Find the smallest possible sum of the digits in the decimal notation of a
  positive multiple of K.
samples: [{"input": "6", "output": "3\n    \n\n12=6\u00d72 yields the smallest sum.\n\n* * *"}, {"input": "41", "output": "5\n    \n\n11111=41\u00d7271 yields the smallest sum.\n\n* * *"}, {"input": "79992", "output": "36"}]