Find the "unwrapped size" of a list Let's define the "unwrapped size" function u of a nested list l (containing only lists) by the following rules:


If l is empty, then u(l) is 1.
If l is non-empty, u(l) is equal to the sum of the unwrapped sizes of every element in l, plus one.


Your task is to write a program (or function) that takes a list as input and outputs (or returns) the unwrapped size of the list.

Test Cases:

[]                                           -&gt;  1
[[[]],[]]                                    -&gt;  4
[[[]],[[[[]],[]]],[[[]],[[[[]],[[],[[]]]]]]] -&gt; 19
[[[[]]]]                                     -&gt;  4


This is code-golf, so the shortest program (in bytes) wins.
Retina, 1 byte

]


Try it online! (The first line enables a linefeed-separated test suite.)

By default, Retina counts the number of matches of the given regex in the input. The unwrapped size is simply equal to the number of [] pairs in the input and therefore to the number of ].