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: class Imos:
      def __init__(self, n):
          self.B = [0] * n
          self.n = n
          from itertools import accumulate
  
          self.ac = accumulate
  
      def __call__(self, l, r):
          l, r = max(l, 0), min(r, self.n - 1)
          self.B[l] += 1
          if r + 1 != self.n:
              self.B[r + 1] -= 1
  
      def out(self):
          (*res,) = self.ac(self.B)
          return res
  
  
  from collections import defaultdict
  
  d = defaultdict(list)
  imos = Imos(10**5 + 1)
  
  (N, C), *D = [[*map(int, o.split())] for o in open(0)]
  for s, t, c in D:
      d[c] += ((s, t),)
  for p in d.values():
      p.sort()
      ps, pt = p[0]
      for s, t in p[1:] + [[0, 0]]:
          if pt == s:
              pt = t
          else:
              imos(ps, pt)
              ps, pt = s, t
  print(max(imos.out()))
  
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"}]