from itertools import permutations, combinations
def is_prime(n):
if n == 1:
return False
i = 2
while i<n:
if n%i==0:
return False
i+=1
return True
def solution(numbers):
numbers = list(numbers)
combi = [] ; combi2 = []
for l in range(1, len(numbers)+1):
combi += combinations(numbers,l)
for l in combi:
c = permutations(l)
for k in c:
a = ''.join(k)
if a not in combi2:
combi2.append(a)
combi2 = list(set((map(int,combi2))))
answer = 0
for i in combi2:
if i < 2:
pass
elif is_prime(i):
answer+=1
return answer