Metabolism comprises the processes that the body needs to function. Basal metabolic rate (BMR) is the amount of energy per unit time that a person needs to keep the body functioning at rest. Some of those processes are breathing, blood circulation, controlling body temperature, cell growth, brain and nerve function, and contraction of muscles. Basal metabolic rate affects the rate that a person burns calories and ultimately whether that individual maintains, gains, or loses weight.

The BMR in kcal per day is calculated using the following formulas (Revised Harris-Benedict Equation):

\(BMR\ (man) = 88.362 + (13.397\ x\ mass\ in\ kg) + (4.799\ x\ height\ in\ cm) - (5.677\ x\ age\ in\ years)\) \(BMR\ (woman) = 447.593 + (9.247\ x\ mass\ in\ kg) + (3.098\ x\ height\ in\ cm) - (4.330\ x\ age\ in\ years)\)

Assignment

Write a program to calculate the BMR of a person with the given characteristics

Input

The mass in kg, height in cm, age in years and the gender (M or F) of a person. All variabels on separate lines. All numbers are integers.

Output

One line containing a single number: the corresponding basal metabolic rate.

Example

Input:

77
192
26
M

Output:

1893.737