Smallest number of contiguous monotonic subsequences A monotonic subsequence is a sequence of numbers \$a_1, a_2, ..., a_n\$ such that
$$a_1 \le a_2 \le ... \le a_n \\
\text{or} \\
a_1 \ge a_2 \ge ... \ge a_n$$
[1, 3, 3, 7, 9, 13, 13, 100] is a monotonic (non-decreasing) subsequence, as well as [9, 4, 4, 3, 0, -10, -12] (this one is non-increasing), but [1, 3, 6, 9, 8] is not. Given a list of integers (in any reasonable format), output the smallest number N such that the sequence of these integers can be split into N monotonic sequences.
Examples
[1, 3, 7, 5, 4, 2] -&gt; [[1, 3, 7], [5, 4, 2]] -&gt; 2
[1, 2, 3, 4, 5, 6] -&gt; [1, 2, 3, 4, 5, 6]     -&gt; 1
[3, 1, 5, 5, 6]    -&gt; [[3, 1], [5, 5, 6]]    -&gt; 2
[4, 6, 8, 9, 1, 6] -&gt; [[4, 6, 8, 9], [1, 6]] -&gt; 2
[3, 3, 3, 3]       -&gt; [[3, 3, 3, 3]]         -&gt; 1
[7]                -&gt; [[7]]                  -&gt; 1
[]                 -&gt; []                     -&gt; anything (you don't actually have to handle an empty list case)
[1, 3, 2, -1, 6, 9, 10, 2, 1, -12] -&gt; [[1, 3], [2, -1], [6, 9, 10], [2, 1, -12]] -&gt; 4
Brachylog, 12 bytes
~c:{&lt;=|&gt;=}al

Try it online!
This returns false. for the empty list [].
Explanation
(?)~c                 Take a list of sublists which when concatenated result in the Input
     :{&lt;=|&gt;=}a        Each sublist must be either increasing or decreasing
              l(.)    Output is the length of that list

This will return the smallest one because ~c will generate choice points from the smallest number of sublists to the biggest.