Death by Taxes

The world was booming...war and destruction everywhere. It all started out a couple of years ago. The world was at its economic bottom...there was little hope left. Most of the resources our nation had have been used up, and with the little money we had left the government was trying to produce as many synthetic supplements as possible to keep the population from starving. Russia's power was growing. After an alliance with the Chinese government, they practically ruled the eastern hemisphere. Our own government was falling apart. Most of the departments were on lock down, and the president was starting to lose all of his credibility. I have been called in as a backup. Despite my choice to become a soldier I am also a programmer. Since most of the programming staff had either been kidnapped or killed by the Russian military, we needed as much help as we could get. Threats. Early this morning we received a call from one of the Chinese officials...apparently no amount of gold could possibly repay our debts to them... so it was either surrender or pay up! I strolled past one of the officers straight towards the huge, bolted titanium doors which lead to the National Economic Data department. As soon as I entered, the smell of sweat and panic filled my lungs. We were gathering our last efforts and checking all of our accounts when the PA system start turned on.

Get ready for another one the vice-president barked damn Chinese... ain't no amount of cash that can satisfy those greedy sons of...his voice was cut off.

I turned one of the laptops and was surprised to find another tax table. I remember when my parents first found out about these...it was devastating... the government confiscated almost everything we had...now they were living in shelters...like the rest of the nation's population.

Tax rateSingleMarried joint filers
Surviving spouses
Heads of householdMarried filing separately
10% $9,075 or less $18,150 or less $12,950 or less $9,075 or less
15% $9,075-$36,900 $18,150-$73,800 $12,950-$49,400 $9,075-$36,900
25% $36,900-$89,350 $73,800-$148,850 $49,400-$127,550 $36,900-$74,425
28% $89,350-$186,350 $148,850-$226,850$127,550-$206,600$74,425-$113,425
33% $186,350-$405,100$226,850-$405,100$206,600-$405,100$113,425-$202,550
35% $405,100-$406,750$405,100-$457,600$405,100-$432,200$202,550-$228,800
39.6%$406,750 or more $457,600 or more $432,200 or more $228,800 or more

The tax formula is taxable_incomeâ‹…tax_rate. Find the tax for a given person.

Input

The first line of the input is the type of filer, one of Single, Married joint filer, Surviving spouse, Head of household, Married filing separately (case-sensitive).
The second line of the input is the taxable income, in dollars.

Output

Print the tax, rounded down.

Constraints

The taxable income is at least $1 and at most $500,000.
The taxable income is NOT divisible by 5.

Sample

InputOutputExplanation
Single
1237
123The tax is $1237 * 10% = $123.7, which is 123 (rounded down).
Married filing separately
70001
17500The tax is $70001 * 25% = $17500.25, which is 17500 (rounded down).
Surviving spouse
472513
187115
Questions?

Sponsors Gold