In case you missed https://codegolf.stackexchange.com/q/150144/62402, here is the definition of a Factor Tree: > * The empty string is 1. * Concatenation represents multiplication. * A number *n* enclosed in parentheses (or any paired characters) represents the *n*th prime number, with 2 being the first prime number. * Note that this is done recursively: the *n*th prime is the factor tree for *n* in parentheses. * The factors of a number should be ordered from smallest to largest. > For example, here are the factor trees for 2 through 10: > () (()) ()() ((())) ()(()) (()()) ()()() (())(()) ()((())) This challenge uses a similar format; however, this challenge is to *decode* these structures. # Test Cases Shamelessly <s>stolen</s> *repurposed* from the last challenge. In addition to the 9 above… ()()((()))((())) => 100 (()(()(()))) => 101 (()())(((())))(()(())) => 1001 (((((((()))))))) => 5381 (()())((((()))))(()()(())(())) => 32767 ()()()()()()()()()()()()()()() => 32768 # Rules * The paired characters in the input are your choice of parentheses, brackets, braces, or angle brackets. I may allow other formats (e.g. XML tags) if asked. * You should be able to handle Factor Trees for any number from 2 to 2<sup>15</sup> or 32768. * Since this is [tag:code-golf], the shortest answer in bytes wins.