Place the fives in a row and place 5 threes between them; this is required by the problem. The rest of the threes can be arbitrarily distributed either between some digits or at either end. The number of such distributions is found using the stars and bars theorem.