#CCBCHMUOI0000035. Bộ tính tiền điện bậc thang (Tiered Electricity Bill)

Bộ tính tiền điện bậc thang (Tiered Electricity Bill)

Tiered Electricity Bill

Source: Phước Hưng OJ

Version: Phuoc Hung OJ Extended

Problem Statement

A household uses n kWh. Its tiered electricity tariff charges the first 50 kWh at 1000 VND/kWh, the next 50 at 1200, the next 100 at 1500, and every kWh above 200 at 2000. Compute the total in integer VND, without extra tax or fees.

Input

One non-negative integer n, electricity consumed in kWh.

Output

Print one integer: the total payable amount in VND.

Subtasks

  • Subtask 1 (20%): 0 <= n <= 50.
  • Subtask 2 (30%): 0 <= n <= 200.
  • Subtask 3 (50%): 0 <= n <= 10^6.

Examples

Example 1

Input

120

Output

140000

Explanation

The first 50 cost 50000, the next 50 cost 60000 and the last 20 cost 30000, totaling 140000.

Example 2

Input

200

Output

260000

Explanation

The first three tiers cost 50000 + 60000 + 150000 = 260000.