#C6610. Nested Lists Sum

    ID: 50390 Type: Default 1000ms 256MiB

Nested Lists Sum

Nested Lists Sum

Given a nested list of integers represented in JSON format, your task is to compute the cumulative sum of all integers within the list irrespective of their nesting level. The list can contain integers and further nested lists. For example, the nested list [1, [2, [3, 4], [5, [6, 7]]], 8, [9]] has a total sum of 45.

You are required to read the input from stdin and output the answer to stdout. The input is a single line containing a valid JSON array. Your solution should correctly parse the nested structure and compute the sum.

Note: All numbers in the list are non-negative integers.

inputFormat

The input consists of a single line: a JSON formatted array containing integers or nested arrays of integers. For example:

[1, [2, [3, 4], [5, [6, 7]]], 8, [9]]

outputFormat

Output a single integer — the sum of all integers in the nested list.

## sample
[1,2,3,4,5]
15