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: import sys
  
  input = sys.stdin.readline
  sys.setrecursionlimit(10**6)
  
  
  ############ ---- Input Functions ---- ############
  def in_int():
      return int(input())
  
  
  def in_list():
      return list(map(int, input().split()))
  
  
  def in_str():
      s = input()
      return list(s[: len(s) - 1])
  
  
  def in_ints():
      return map(int, input().split())
  
  
  n = in_int()
  
  
  while n % 2 == 0:
      n = n // 2
  
  while n % 5 == 0:
      n = n // 5
  
  
  ans = sum(list(map(int, list(str(n)))))
  
  for i in range(1, n):
      x = sum(list(map(int, list(str(n * i)))))
      ans = min(x, ans)
  
  
  print(ans)
  
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"}]