fun main(args: Array<String>) {
    val input = readLine()?.split(" ") ?: return
    val age = input[0].toInt()
    val price = input[1].toInt()
    if (0 > age || age > 100) return
    if (price < 2 || price > 1000) return
    println(
        when {
            age <= 5 -> 0
            age in 6..12 -> {
                price / 2
            }
            age >= 13 -> {
                price
            }
            else -> 0
        }
    )
}