How many numbers of length $N$ contain exactly two $5$'s and exactly three $7$'s? I want to compute the number of numbers of length $N$ , such that count of digit 5 is 2 and count of digit 7 is 3. The rest of the places can be filled by any digits i.e. repetition  is allowed. 
Can I directly calculate it or do I have to make cases?  
For example, below are some valid numbers of length $8$, where count of $5$ is $2$ and count of $7$ is $3$.
55777123
51577279

 A: You can almost calculate it without any cases, but there is a slight extra complication from the fact that the first digit can't be $0$.
If you just wanted to know how many strings of $N$ digits with exactly two $5$s and three $7$s, then you can first choose two places from $N$ for the $5$s, then three places (from the remaining $N-2$) for the $7$s. Then you have $N-5$ places to fill, and each one can be any of the other $8$ digits. So that gives $\binom N2\binom{N-2}38^{N-5}$
ways.
Unfortunately this includes things like $05787735$, which you don't want. So you need to subtract off the number of strings which start with a $0$, and have two $5$s and three $7$s. You should be able to use the same method to calculate how many strings of this form there are.
A: Hint -
You have to take cases where 5 repeated at least twice and 7 repeated at least thrice.
Alternate way is find the number of ways number with length N can be arranged and then subtract cases with at most 5 repeating only once and 7 repeating at most twice.
