VZLA2019I - Italian Dinner

Elizabeth and Veronica (Eli and Vero) are always traveling around the world, visiting new countries, going to interesting places and, of course, many restaurants to try the cuisine!

This time they are in Italy! They learn new things everyday, and today they learned the structure of the traditional Italian meals. They usually consist of five components, or courses:

  1. The antipasto
  2. The primo
  3. The secondo
  4. The contorno
  5. The dolce

For every course, there is a set of options the consumer can choose from. It is an Italian tradition to ask for exactly one option of each course.

Eli and Vero want to know how many different dinners they can ask, given how many options the restaurant offers for each course. Also, they will ask for something to drink, so they will add themselves their own course: the bevanda.

Input

The first and only line of the input consists of six integers Ci separated exactly by a single white space, representing the number of antipastos, primos, secondos, contornos, dolces and bevandas Eli and Vero can choose from respectively.

Output

Print the number of different dinners Eli and Vero can order.

Example

Input:
1 1 1 2 1 1

Output:
2
Input:
2 3 1 2 4 1

Output:
48
Input:
5 10 2 8 7 4

Output:
22400

Constraints

  • 1 ≤ Ci ≤ 50

Added by:Samuel Nacache
Date:2019-10-27
Time limit:1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All
Resource:Rubmary Rojas - Used for Venezuelan 2019 ICPC Local Contest

hide comments
2019-10-28 14:12:01
Please move to Basics.
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.