implicit none

integer A,B,money

write(6,*) 'A B'
do
	read *,A,B
	if(A.ge.0 .and. A.le.100 .and. B.ge.2 .and. B.le.1000 .and.mod(B,2)==0) exit
end do

if(A.ge.13)					money=B
if(A.ge.6 .and. A.le.12) 	money=B*0.5
if(A.le.5)					money=0
write(6,'(i4)') money

end