// Arup Guha
// 7/14/05
// Solution to BHCSI 7/15/05 Programming Contest Problem: Taxes
// Edited on 7/13/06 to use Scanner and read from a file for
// 2006 BHCSI Mock Contest #1.

import java.util.*;
import java.io.*;

public class taxes {

  public static void main(String[] args) throws IOException {

    Scanner fin = new Scanner(new File("taxes.in"));

    // Loop through three cases.
    for (int i=0; i<3; i++) {

      // Read in the annual income.
      double income = fin.nextDouble();
      double saveincome = income;

      // Start with paying no tax.
      double tax = 0;

      // Pay for the money in the highest bracket, afterwards $25000 left.
      if (income > 25000) {
        tax = tax + (income-25000)*.25;
        income = 25000;
      }

      // Pay for the next bracket, afterwards $15000 left.
      if (income > 15000) {
        tax = tax + (income-15000)*.2;
        income = 15000;
      }

      // Pay for the lowest bracket.
      if (income > 5000) 
        tax = tax + (income-5000)*.15;      
    
      // Output the result.
      System.out.print("Your tax on an income of $"+saveincome);
      System.out.println(" is $"+tax+".");
    }
  }

}
