fun main(args: Array<String>) {

    val (age, cost) = readLine()!!.split(" ").map { Integer.parseInt(it) }
    when {
        age >= 13 -> print(cost)
        age >= 6 -> print(cost / 2)
        else -> print(0)
    }
}