Arrangement with repetitions:
If x items out of n items are repeated, then the number of ways of arranging these n items is $$\dfrac{n!}{x!}$$ ways.
If x items, y items and z items are repeated within n items, they can be arranged in $$\dfrac{n!}{x!y!z!}$$ ways.