Robots#363

Robots

1 second
64 megabytes
Hard

A colony of robots operates according to the following rules:

  1. In one year, robots produce new robots, and robots produce new robots.

  2. Robots always try to produce as many new robots as possible.

Initially, there are robots in the colony. How many robots will there be after years? (All input values do not exceed , and the result does not exceed .)

Input

A single line contains the integers , , , , , separated by spaces.

Output

Output a single integer — the required number of robots.

Examples

Example 1

Loading
Loading