#CCBCMCHIN0000029. Mức giảm giá theo bậc (Tiered Discount)

Mức giảm giá theo bậc (Tiered Discount)

Tiered Discount

Source: Phước Hưng OJ

Version: Phuoc Hung OJ Extended

Problem Statement

A store applies exactly one discount tier based on original price pp: below 100100 the discount is zero; from 100100 to below 500500 it is 1010; from 500500 onward it is 5050. Compute the amount payable. Discounts are not cumulative.

Input

One integer pp is the original price.

Output

Print one integer: the amount to pay.

Subtasks

  • Subtask 1 (20 points): 0≤p<1000\le p<100.
  • Subtask 2 (30 points): 0≤p<5000\le p<500.
  • Subtask 3 (50 points): 0≤p≤1060\le p\le10^6.

Examples

Input

500

Output

450

Explanation

Price 500500 belongs to the last tier including its lower boundary. The single discount is 5050, so the payment is 500−50=450500-50=450.