Counting Antibodies

아직 제출이 없습니다시간 제한1초메모리 제한512 MB

문제

Immunoglobulins also known as antibodies are protein molecules. Antibodies play one of the key roles in the immune reaction --- they detect harmful foreign agents --- bacteria or viruses --- and help to eliminate them. Every foreign molecule binds with unique type of antibody. There are plenty of potential harmful agents, so, there should be a tremendous number of immunoglobulin types to neutralize all threats. Huge required amount of immunoglobulin types make it impossible to encode each type in DNA. Luckily, there is a solution.

Immunoglobulins are produced by immune cells: B-lymphocytes based on DNA information --- genes. Immunoglobulin genes are combined from DNA fragments like constructor. Each fragment exists in several variants and is responsible for variable region of immunoglobulin molecule. This process is called somatic recombination. 

Immunoglobulin molecule consists of two identical heavy chains and two identical light chains. There are two types of light chains with similar structure --- κ\kappa and λ\lambda. Both of two light chain types have two variable regions --- VV and JJ. To form a variable region one gene fragment is selected from multiple variants: V_κV\_\kappa and J_κJ\_\kappa variants for VV and JJ regions respectively in κ\kappa-light chain, or V_λV\_\lambda and J_λJ\_\lambda variants for VV and JJ regions respectively in λ\lambda-light chain.

There is only one heavy chain type with three variable regions --- VV, DD and JJ. To form each of them one gene fragment from V_hV\_h, D_hD\_h and J_hJ\_h variants respectively is selected.

You need to count how many possible immunoglobulin molecules can be produced for given values of V_κV\_\kappa, J_κJ\_\kappa, V_λV\_\lambda, J_λJ\_\lambda, V_hV\_h, D_hD\_h and J_hJ\_h.

입력

The first line contains two integers V_κV\_\kappa, J_κJ\_\kappa (1Vκ,Jκ15001 \leq V\kappa, J\kappa \leq 1500) --- number of gene fragment variants for κ\kappa-light chain  VV and JJ variable regions, respectively.

The second line contains two integers V_λV\_\lambda, J_λJ\_\lambda (1V_λ,J_λ15001 \leq V\_\lambda, J\_\lambda \leq 1500) --- number of gene fragment variants for λ\lambda-light chain VV and JJ variable regions, respectively.

The third line contains three integers V_hV\_h, D_hD\_h and J_hJ\_h (1V_h,D_h,J_h10001 \leq V\_h, D\_h, J\_h \leq 1000) --- number of gene fragment variants for heavy chain VV, DD and JJ variable regions, respectively.

출력

Output one integer --- number of immunoglobulin variants that can be produced.

힌트

In conclusion, we note that somatic recombination is powerful protective mechanism for various bacteria and viruses, but not only one. Other ways to prevent foreign invasion are beyond the focus of this problem.