The Call of Rain#4401

The Call of Rain

2 seconds
64 megabytes
Easy

Ritual shamans Six-String Neck and He Who Creates Joy are preparing for the grand festival honoring the deity Btas Odappoed and the pilgrimage to the sacred city of Amostork.

The pilgrimage is to culminate in an intricate ritual to summon rain from fish, which unfolds as follows:

It is known that the ritual's success increases with the product of the digits of the number written on the first hedgehog found. However, since no shaman who has started the ritual has ever returned, the shamans decided to bend the rules slightly and keep the hedgehog with the highest product of digits in the number written on it. The task is to determine which hedgehog to keep.

Input

The first line of the input contains a single integer (1 \leq N \leq 10^9) — the number of hedgehogs selected by breeders.

Output

Output the product of the digits of the number written on the back of the hedgehog with the maximum product.

Examples

Example 1

Loading
Loading