UVA12942 Sub-expression Counting

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=862&page=show_problem&problem=4821 [PDF](https://uva.onlinejudge.org/external/129/p12942.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12942/ba5c3b161cd4bd01f1c55d7ccd7a566c8d30e76d.png)

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12942/05370eee0aa2864924d2b02017e282f1a268495a.png)

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12942/ff30e259fec6714e2de9177f30d1251f6e1cc071.png)