input: from typing import List
  
  def calculate_fibonacci_up_to_n(n: int) -> List[int]:
      """
      Calculate the Fibonacci sequence up to a given number n.
      The Fibonacci sequence starts with 0 and 1, and each subsequent number is the sum of the previous two.
      
      >>> calculate_fibonacci_up_to_n(0)
      [0]
      >>> calculate_fibonacci_up_to_n(5)
      [0, 1, 1, 2, 3, 5]
      >>> calculate_fibonacci_up_to_n(10)
      [0, 1, 1, 2, 3, 5, 8]
      """
output:     if n < 0:
          return []
      if n == 0:
          return [0]
      fib_sequence = [0, 1]
      while True:
          next_value = fib_sequence[-1] + fib_sequence[-2]
          if next_value > n:
              break
          fib_sequence.append(next_value)
      return fib_sequence