input: Write a function to determine the maximum chain length from a given list of pairs.
  assert max_chain_len([Pair(5, 24), Pair(15, 25), Pair(27, 40), Pair(50, 60)], 4) == 3
  assert max_chain_len([Pair(1, 2), Pair(3, 4), Pair(5, 6), Pair(7, 8)], 4) == 4
  assert max_chain_len([Pair(19, 10), Pair(11, 12), Pair(13, 14), Pair(15, 16), Pair(31, 54)], 5) == 5
output: def max_chain_len(pairs, n):
      pairs.sort(key=lambda x: x.b)
      current_end, count = float('-inf'), 0
      for pair in pairs:
          if pair.a > current_end:
              current_end = pair.b
              count += 1
      return count