Find the no. of permutations of letters a , b , c , d, e , f , g taken all at a time if "beg" pattern cannot appear in any word.