output_description: Print the minimum possible value of "the sum of the digits of A" plus "the sum
  of the digits of B".
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N
attempt: import numpy as np
  
  N = int(input())
  ku = np.zeros((N, 2), dtype=int)
  
  for i in range(N):
      l = list(map(int, input().split()))
      ku[i][0] = l[0]
      ku[i][1] = l[1]
  
  
  K = 0
  now = 0
  for i in range(N):
      a = np.zeros(len(ku))
      flag = np.zeros(len(ku))
      for j in range(len(ku)):
          if now > ku[j][0] and now < ku[j][1]:
              a[j] = 0
              flag[j] = 0
          elif now < ku[j][0]:
              a[j] = abs(now - ku[j][0])
              flag[j] = 1
          else:
              a[j] = abs(now - ku[j][1])
              flag[j] = 2
      idx = a.argmax()
      K += a[idx]
  
      if flag[idx] == 1:
          now = ku[idx][0]
      elif flag[idx] == 2:
          now = ku[idx][1]
      ku = np.delete(ku, 0, 0)
  
  K += abs(now)
  print(int(K))
  
problem_description: Statement
  
  Takahashi has two positive integers A and B.
  
  It is known that A plus B equals N. Find the minimum possible value of "the
  sum of the digits of A" plus "the sum of the digits of B" (in base 10).
samples: [{"input": "15", "output": "6\n    \n\nWhen A=2 and B=13, the sums of their digits are 2 and 4, which minimizes the\nvalue in question.\n\n* * *"}, {"input": "100000", "output": "10"}]