function Main(input){
	var X = parseInt(input,10);
  	var d = Math.floor(X/5);
  	var fhc = Math.floor(d/100);
  	var fc = d%100;
  	var res = (fhc * 1000) + (fc * 5);
	console.log(res);
}
Main(require("fs").readFileSync("/dev/stdin","utf8"));