import java.util.Scanner;
public class FlightTickets{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
{System.out.println("please input the date and individed the month and the day by','");}
String date_1 =sc.nextLine();
String [] date = date_1.split(",");
int[] time = new int[2];
for(int i=0;i<date.length;i++)
{
time[i]=Integer.parseInt(date[i]); //著名输入算法
}
Scanner scan = new Scanner(System.in);
{System.out.println("please input the amount of your tickets");}
int amount = scan.nextInt();
int price=0;
switch(time[1]){
case 1:
if(time[2]==1||time[2]==28)
price=1200;
else if(time[2]==7||time[2]==8||time[2]==14||time[2]==15||time[2]==21||time[2]==22||time[2]==29)
price=1200*8/10;
else price=1200*6/10;
break;
case 2:
if(time[2]==11)
price=1200;
else if(time[2]==4||time[2]==5||time[2]==12||time[2]==18||time[2]==19||time[2]==25||time[2]==26)
price=1200*8/10;
else price=1200*6/10;
break;
case 3:
if(time[2]==0)
price=1200;
else if(time[2]==4||time[2]==5||time[2]==11||time[2]==12||time[2]==18||time[2]==19||time[2]==25||time[2]==26)
price=1200*8/10;
else price=1200*6/10;
break;
case 4:
if(time[2]==4)
price=1200;
else if(time[2]==1||time[2]==2||time[2]==8||time[2]==9||time[2]==15||time[2]==16||time[2]==22||time[2]==23||time[2]==29||time[2]==30)
price=1200*8/10;
else price=1200*6/10;
break;
case 5:
if(time[2]==1||time[2]==30)
{price=1200;}
else if(time[2]==6||time[2]==7||time[2]==13||time[2]==14||time[2]==20||time[2]==21||time[2]==27||time[2]==28)
price=1200 * 8 / 10;
else price=1200 * 6 / 10;
break;
case 6:
if(time[2]==0)
price=1200;
else if(time[2]==3||time[2]==4||time[2]==10||time[2]==11||time[2]==17||time[2]==18||time[2]==24||time[2]==25)
price=1200*8/10;
else price=1200*6/10;
break;
case 7:
if(time[2]==0)
price=1200;
else if(time[2]==1||time[2]==2||time[2]==8||time[2]==9||time[2]==15||time[2]==16||time[2]==22||time[2]==23||time[2]==29||time[2]==30)
price=1200*8/10;
else price=1200*6/10;
break;
case 8:
if(time[2]==0)
price=1200;
else if(time[2]==5||time[2]==6||time[2]==12||time[2]==13||time[2]==19||time[2]==20||time[2]==26||time[2]==27)
price=1200*8/10;
else price=1200*6/10;
break;
case 9:
if(time[2]==0)
price=1200;
else if(time[2]==2||time[2]==3||time[2]==9||time[2]==10||time[2]==16||time[2]==17||time[2]==23||time[2]==24||time[2]==30)
price=1200*8/10;
else price=1200*6/10;
break;
case 10:
if(time[2]==1||time[2]==4)
price=1200;
else if(time[2]==7||time[2]==8||time[2]==14||time[2]==15||time[2]==21||time[2]==22||time[2]==28||time[2]==29)
price=1200*8/10;
else price=1200*6/10;
break;
case 11:
if(time[2]==0)
price=1200;
else if(time[2]==4||time[2]==5||time[2]==11||time[2]==12||time[2]==18||time[2]==19||time[2]==25||time[2]==26)
price=1200*8/10;
else price=1200*6/10;
break;
case 12:
if(time[2]==0)
price=1200;
else if(time[2]==2||time[2]==3||time[2]==9||time[2]==10||time[2]==16||time[2]==17||time[2]==23||time[2]==24||time[2]==30||time[2]==31)
price=1200*8/10;
else price=1200*6/10;
break;
}
{System.out.println("the price is "+price * amount);}
{System.out.println("\n");}
}
}