import java.util.*;

public class Main { public static void main(String[] args) { Scanner console = new Scanner(System.in); int price = console.nextInt(); int cost = 0;

    //write your code here......
    if(price >= 5000){//满5000全额打6折
        cost += ((price)*0.6);
    }else if(price >= 2000){//满2000全额打7折
        cost += ((price)*0.7);
    }else if(price >= 500){//满500全额打8折
        cost += ((price)*0.8);
    }else if(price >= 100){//满100全额打9折
        cost += ((price)*0.9);
    }else{
        cost += price;
    }
    

    System.out.println(cost);
}

}