main = getLine >>= print . ev . map read . words ev [p,d] = evp^p * evd^d where evp = sum [2,3,5,7,11,13] / 6 evd = sum [4,6,8,9,10,12] / 6