solve :: Int -> Int -> Int
solve age charge
  | age >= 13 = charge
  | age >= 6 = charge `div` 2
  | otherwise = 0
  
main :: IO ()
main = do
  [a, b] <- map read . words <$> getLine
  print $ solve a b