output_description: When the minimum fee is x yen, print the value of x.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N A B
attempt: N, C = map(int, input().split())
  STC = []
  for _ in range(N):
      s, t, c = map(int, input().split())
      STC.append([s, t, c])
  STC.sort()
  
  rs = [[STC[0][1], STC[0][2]]]
  for i in range(1, N):
      len_rs = len(rs)
  
      min_idx = None
      for j in range(len_rs):
          if rs[j][1] != STC[i][2]:
              tmp_stc_r = STC[i][0] - 0.5
          else:
              tmp_stc_r = STC[i][0]
  
          if rs[j][0] <= tmp_stc_r:
              if min_idx is None:
                  min_idx = j
              else:
                  if rs[j][0] < rs[min_idx][0]:
                      min_idx = j
  
      if min_idx is None:
          rs.append([STC[i][1], STC[i][2]])
      else:
          rs[min_idx] = [STC[i][1], STC[i][2]]
  
  print(len(rs))
  
problem_description: Statement
  
  You are parking at a parking lot. You can choose from the following two fee
  plans:
  
    * Plan 1: The fee will be A×T yen (the currency of Japan) when you park for T hours.
    * Plan 2: The fee will be B yen, regardless of the duration.
  
  Find the minimum fee when you park for N hours.
samples: [{"input": "7 17 120", "output": "119\n    \n\n  * If you choose Plan 1, the fee will be 7\u00d717=119 yen.\n  * If you choose Plan 2, the fee will be 120 yen.\n\nThus, the minimum fee is 119 yen.\n\n* * *"}, {"input": "5 20 100", "output": "100\n    \n\nThe fee might be the same in the two plans.\n\n* * *"}, {"input": "6 18 100", "output": "100"}]