function main(input) {
  var age = Number(input.split(' ')[0]);
  var price = Number(input.split(' ')[1]);
  if (age <= 5) {
    console.log(0);
  } else if (age <= 12) {
    console.log(price / 2);
  } else {
    console.log(price);
  }
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));