from itertools import permutations
from string import join
arrangements = [ ]
for p in permutations ( 'ugccsir', 6 ) :
arrangement = join ( p, '' )
if 'ui' in arrangement :
continue
if not arrangement in arrangements :
arrangements . append ( arrangement )
print len ( arrangements )
The above Python code gives a result of 2,220.