Background
----------

Define a **run** in a list as a maximal contiguous subsequence of identical values. For example, the list

```
0 0 0 1 1 0 3 3 3 2 2

```

has five runs of lengths 3, 2, 1, 3, 2 respectively. (Think of run-length encoding.)

Then define a **cut operation** as removing one item from each run of a list. Applied to the list above, the result will be `0 0 1 3 3 2`.

Finally, the **cut resistance** of a list is the number of cut operations needed to reduce it to an empty list. The cut resistance of the list above is 3:

```
0 0 0 1 1 0 3 3 3 2 2
0 0 1 3 3 2
0 3
(empty)

```

Note that the cut resistance can be higher than the maximal run length, since multiple runs may fuse in the way:

```
1 0 0 1 1 0 0 1 0 0 1 0 0 1 0 1 0
0 1 0 0 0
0 0
0
(empty)

```

Related OEIS sequence: [A319416](http://oeis.org/A319416) (cut resistance of n written in binary)

Task
----

Given a (possibly empty) list of nonnegative integers, compute its cut resistance.

Standard [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'") rules apply. The shortest code in bytes wins.

Test cases
----------

```
0 0 0 1 1 0 3 3 3 2 2 => 3
1 0 0 1 1 0 0 1 0 0 1 0 0 1 0 1 0 => 4
1 2 3 4 5 99 100 101 => 1
4 4 4 4 4 4 3 3 3 3 2 2 1 2 2 3 3 3 3 4 4 4 4 4 4 => 7
(empty) => 0

```