#t279. 砝码称重

砝码称重

Weight Measurement

Problem Background

Special for beginners, ^_^

Problem Description

Suppose there are several weights of 1g1\text{g}, 2g2\text{g}, 3g3\text{g}, 5g5\text{g}, 10g10\text{g}, 20g20\text{g} each (their total weight is at most 10001000). Compute how many different weights can be measured using these weights, excluding the case of using no weight at all.

Input Format

One line containing six positive integers a1,a2,a3,a4,a5,a6a_1, a_2, a_3, a_4, a_5, a_6, meaning there are a1a_1 weights of 1g1\text{g}, a2a_2 of 2g2\text{g}, ..., a6a_6 of 20g20\text{g}. Adjacent integers are separated by a single space.

Output Format

Output in the form Total=N, where NN is the number of different weights that can be measured.

Sample Input

1 1 0 0 0 0

Sample Output

Total=3

Hint

The sample's weights can measure 1g1\text{g}, 2g2\text{g}, 3g3\text{g} — three different weights.

Note: the prefix Total= must be printed exactly as shown, followed directly by the integer NN.

Constraints

Time limit: 1s, memory limit: 1024KiB for each test case.