output_description: Print the minimum total cost required to complete all the task.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      A_1 A_2 A_3
attempt: class Need(object):
      def __init__(self, arg1, arg2):
          self.island1 = int(arg1)
          self.island2 = int(arg2)
          self.bridge = []
          for i in range(arg1, arg2):
              self.bridge.append(i)
  
      def GETbridge(self):
          return self.bridge
  
  
  deadbridges = 0
  islands, needsnum = map(int, input().split())
  bridge = [0 for _ in range(islands - 1)]
  box = []
  for i in range(needsnum):
      arg1, arg2 = map(int, input().split())
      box.append(Need(arg1, arg2))
  # ここから投票をする。
  while len(box) != 1:
      bridge = [0 for _ in range(islands - 1)]
      for need in box:
          list = need.GETbridge()
          for ing in list:
              bridge[ing - 1] = bridge[ing - 1] + 1
      # 集計終わり
      maxi = 0
      for i in range(len(bridge)):
          if bridge[i] > bridge[maxi]:
              maxi = i
      # 橋を削除
      deadbridges = deadbridges + 1
      # 要望を削除
      kill = False
      for i in range(len(box)):
          try:
              s = box[i].GETbridge()
          except:
              break
          for k in s:
              if k == bridge[maxi]:
                  kill = True
                  break
          if kill:
              box.pop(i)
              i = i - 1
  print(deadbridges)
  
problem_description: Statement
  
  You have three tasks, all of which need to be completed.
  
  First, you can complete any one task at cost 0.
  
  Then, just after completing the i-th task, you can complete the j-th task at
  cost |A_j - A_i|.
  
  Here, |x| denotes the absolute value of x.
  
  Find the minimum total cost required to complete all the task.
samples: [{"input": "1 6 3", "output": "5\n    \n\nWhen the tasks are completed in the following order, the total cost will be 5,\nwhich is the minimum:\n\n  * Complete the first task at cost 0.\n  * Complete the third task at cost 2.\n  * Complete the second task at cost 3.\n\n* * *"}, {"input": "11 5 5", "output": "6\n    \n\n* * *"}, {"input": "100 100 100", "output": "0"}]