The number of different strings of length 5 from the alphabet $\{1,2,3,4,5\}$ is what you want to calculate. There are $5^5$ such strings, as each element of the string can be chosen in 5 different ways and you then apply the "rule of product".
However, you then mention that, "If there is a 0 in the given numbers then initial 0 is [invalid]." Now, this is not really the same question. You said you were given the alphabet $\{1,2,3,4,5\}$. If this is actually the case, you wouldn't have to worry about zeros. Then again, if you did have the alphabet $\{0,1,2,3,4,5\}$ instead, then you would have to deduct the strings of types "0xxxx","00xxx","000xx","0000x", and "00000" from $6^5$ which would be the total number of strings. I will let you figure out how many strings of type "0xxxx", etc. there are.
EDIT: The question is somewhat unclear but I notice, from the discussion in the comments above, that you are not looking for selections with repetition (?). In that case, I believe what you are looking for is a formula, also given by barak manos in the comments above, namely $\dfrac{5!}{2!2!1!}$ for "11223" for example.
To derive this, you have to realize that $5!$ is first how many ways we can permute five elements. Then, if you see the two '2':s as different, you can permute them in $2!$ ways, the '3':s in $2!$ ways, and the '1':s (trivially) in $1!$ way. The formula is then to divide the total number of permutations ($5!$ in your case) with the product of all the ways you can permute each set of elements that are "the same" (the '2':s and the '3':s in the example).
Ex. How many words can we create from "BANANA"? Answer: $\dfrac{6!}{3!2!}$ (omitting the $1!$).
Hopefully I have interpreted your question correctly, otherwise, please make it clearer.
Tip: If you are counting selections of items from sets, go straight to binomial coefficients and do not pass confusion about "order not being important".
${}^n\mathrm C_r$ counts selections of $r$ items from $n$. Then you just need to puzzle out whatfore you are selecting from wherefore.
To count selections of three items from eight when two of the items are incompatible, you:
Count the selections of any three from all eight, minus selections of both incompatible and one from the other six.$$\require{cancel}{}^8\mathrm C_3-\bcancel{{}^2\mathrm C_2}{}^6\mathrm C_1 = \dfrac{8\cdot 7\cdot 6}{3\cdot 2\cdot 1}-\frac{6}{1}$$
Count the selection of any three from the other six, plus the selections of one from the incompatibles and two from the other six.
$${}^6\mathrm C_3+{}^2\mathrm C_1{}^6\mathrm C_2~=~\frac{6\cdot 5\cdot 4}{3\cdot 2\cdot 1}+\frac{2}{1}\cdot\frac{6\cdot 5}{2\cdot 1}$$
Best Answer
You may refer to the research paper: Haim Mendelson (1981), On permutations with limited repetition, Journal of combinatorial theory, Series A, vol. 30
The paper provides the following recursive equations, with $n$ the number of objects, $r$ the size of the permutation, and $s$ the number of possible repetitions for each object \begin{align} f(n,r+1,s)&=n f(n,r,s)-n\left(^r_s\right)f(n-1,r-s,s) \quad \textrm{ for } n=2,3,... ; r \ge s\\ f(n,r,s)&=n^r \quad \textrm{ for } n=1,2,3,\dots;r \le s\\ f(1,r,s)&=0 \quad \textrm{ for } r>s \end{align}
The paper gives the following explanation for the first equation:
"There are $f(n,r,s)$ ways to select the first $r$ elements without repeating any object more than $s$ times. Out of these, there are $\left(^r_s\right)f(n-1,r-s,s)$ r-permutations with a given object exaclty $s$ times. Thus, out of the $nf(n,r,s)$ possibilities attained by appending an r-permutation with limited repetition $s$ with an $(r+1)$st element, $n\left(^r_s\right)f(n-1,r-s,s)$ will violate the upper limit $s$."
The second equation is the case when the number of repetitions is larger than the size of the permutation (identical to unlimited repetitions).